简体   繁体   中英

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM