Virtual folder for multiple sites

Posted by Cups on Server Fault See other posts from Server Fault or by Cups
Published on 2012-11-07T15:49:01Z Indexed on 2012/11/07 17:03 UTC
Read the original article Hit count: 153

Filed under:
|
|

I am creating a very simple flat file CMS for small (multilingual) websites. The little file writing that goes on is handled by 4 scripts in a publicly available folder in each site named /edit.

Given that I have 2 websites now working on that simple system:

websiteA/index.php (etc)
websiteA/edit/

websiteB/index.php (etc)
websiteB/edit/

What is the best way of making that /edit folder "virtual" in order that these and each subsequent website owner can login to their view of /edit and yet the code only exists in one place.

I do not want the website owners to have to login from a central website, but from their own /edit directory.

I have already read about different solutions seemingly using the <Directory> directive in my httpd.conf declaration for each website, and also using straight mod_rewrite but admit to now becoming confused about some of the terminology.

Each website has its own config file which contains path settings and so on.

What in your opinion is the best way to handle this?

EDIT In light of a reply, I suppose that given a virtual host directive such as this:

<VirtualHost 00.00.00.00:80>
DocumentRoot /var/www/html/websitea.com
ServerName www.websitea.com
ServerAlias websitea.com
DirectoryIndex index.htm index.php
CustomLog logs/websitea combined
</VirtualHost>

Is it possible to create an alias inside that directive for the folder websitea.com/edit ?

© Server Fault or respective owner

Related posts about apache2

Related posts about php