Multiple websites admin folder from central codebase
I've written a small CMS system for my companies' customers.
It is supposed to run the 'admin' folder off the same codebase.
So if I have my codebase in the folder 'a.com/admin', 开发者_开发技巧then I could set up a new website on b.com, and when I go to 'b.com/admin', it should show the admin folder from 'a.com'.
Settings and configuration are handled by config files named after the HTTP_HOST.
I have tried Apache Alias, but couldn't get it working.
Then the solution would maybe be lndir to make shadow copies, but then we have to run that every time we create a new file.
Any suggestions?
I haven't used Apache for a while, but maybe this could work?
<VirtualHost>
...
<Directory /admin>
DocumentRoot "/path/to/a.com/public_html/admin"
</Directory>
</VirtualHost>
I got it working. Found out that I could set a custom per-domain httpd.conf:
Alias /admin "/home/xxxxx/domains/xxxx.com/public_html/admin"
DirectoryIndex index.php
精彩评论