Jump to content

rename wire "wire" directory


mrkhan
 Share

Recommended Posts

All the instructions are in the index.config.php file. See below, edited to reflect your current setup.
 
Have you also read this? https://processwire.com/api/modules/multi-site-support/ - Edit: OK, I see you said you have.

<?php

/**
 * ProcessWire multi-domain configuration file (optional)
 *
 * If used, this file should be copied/moved to the ProcessWire installation root directory.
 *
 * ProcessWire 2.x 
 * Copyright (C) 2013 by Ryan Cramer 
 * Licensed under GNU/GPL v2, see LICENSE.TXT
 * 
 * http://processwire.com
 * 
 */

if(!defined("PROCESSWIRE")) die();

/**
 * Multi-domain configuration: Optionally define alternate /site/ dirs according to host
 *
 * If used, this file should be placed in your web root and then edited as follows. 
 *
 * This function returns an array that should be in the format where the array key
 * is the hostname (including domain) and the value is the /site/ directory you want to use.
 * This value must start with 'site-', i.e. 'site-domain' or 'site-something'. This is to
 * ensure that ProcessWire's htaccess file can recognize and protect files in that directory.
 *
 * Note that if your site may be accessed at either domain.com OR www.domain.com, then you'll
 * want to include entries for both, pointing to the same /site-domain/ directory. 
 * 
 * Each /site/ dir has it's own /site/config.php file that should be pointing to a separate
 * database. You shouldn't have two different /site/ dirs sharing the same database. 
 *
 */
function ProcessWireHostSiteConfig() {

        return array(

                /*
                 * Some Examples (you should remove/replace them if used).
		 * Just note that the values must begin with 'site-'.
                 *
                 */
                 'domain1.com' => 'site-domain1',//these value, site-domain1 is a folder/directory
                 'domain2.com' => 'site-domain2',
                 'domain3.com' => 'site-domain3',

		/*
		 * Default for all others (typically /site/)
	 	 *
		 */
		'*' => 'site',

                );

}

Finally, what do you mean it is not working? What exactly are you seeing? Any errors reported?

Edited by kongondo
Link to comment
Share on other sites

This setup is meant to work with all your site directories in the same folder. Means this should look like below and all three domains (domain1.com, domain2.com. domain3.com) have to point to the same physical location. Here this would be /home/web1/public_html/. For this setup the index.config.php kongondo posted would do the expected job. 

/home/web1/public_html/
    ⌊ site-domain1
    ⌊ site-domain2
    ⌊ site-domain3
    ⌊ wire

Maybe your setup would work if you symlink the wire director to all your public_hml folders and all the public_html folders containing the index.php and .htaccess. But I can't tell if the symlinked wire directory would find the site directory.

  • Like 2
Link to comment
Share on other sites

To make it clear, there are two suggestions here:

The first is to keep the folder scheme that you have now and symlink the wire directory. You don't have to configure anything on apache because it seems that this is how it's working for you already. This would look like:

home

    web1

        public_html

            wire (the real one)

            site

            etc...

    web2

        public_html

            wire (link to the first wire) 

            site

            etc...

    web3

        public_html

            wire (also link to the first wire) 

            site

            etc...

The second one is to use the multisite technique that I referred before. For that you will have to configure the host (on your computer and server) to point all domains to the same folder. I'm not going to explain how to do this because it depends on your system, but already gave you the words that I would use to search for it on search engines. This solution will take some effort from your part to learn something about setting virtual hosts, and I wouldn't recommend it if you're not willing to look for that information for yourself. Anyway, once you set up your server to point all domains to the same folder, adding a new site is as easy as creating a new DB, copying a new site folder from the PW zip and naming it to "site-something", and adding it to the index.config.php file as described before.

Link to comment
Share on other sites

Hello diogo,

i like your structure and want to have multisite like this but i don't understand do i need to have wire directory in each website 

home

    web1

        public_html

            wire (the real one)

            site

            etc...

    web2

        public_html

            wire (link to the first wire) 

            site

            etc...

    web3

        public_html

            wire (also link to the first wire) 

            site

            etc...

 

as you say wire (link to the first wire) what do you mean by this ?

and this is what i am struggling how to create that link from web2 or web3 to real wire directory in web1, do i need to do settings in some file as index.config.php in root is working for me :(

Thanks

Link to comment
Share on other sites

Thanks every one for helping me. here is what i did to solve my issue just to help some one if he looking for same solution.

my website directory structure is

Home
⌊ site1
     ⌊ site
     ⌊ wire
⌊ site2
      ⌊ site
⌊ site3
      ⌊ site

if you see i have only one directory of wire in site1 folder. in other two websites site2 and site3 i created a PHP file in root and name it link.php

so i can access this site like http://domain/link.php or http://localhost/site2/link.php

here is my code for link.php

<?php// for localhost , we can also set this according to our web server path also
$target = '/Applications/XAMPP/xamppfiles/htdocs/site1/wire';
$shortcut = 'wire';

symlink($target, $shortcut);

echo readlink($shortcut);
?>

when you run this PHP this will create a link directory to your WIRE directory and website will start working :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...