Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

The code is organized in the following directory structure:

/frontend/  
  index.php
  ...
/backend/  
  index.php
  ...

Note that /frontend and /backend are at the same level.

I have setup a virtual host that makes www.domain.com points to /frontend/index.php. Is it possible to make www.domain.com/admin points to /backend/index.php, without setting up another virtual host (e.g., admin.domain.com)?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Try the Alias and ScriptAlias tags.

share|improve this answer
RewriteEngine On
RewriteRule ^/admin/$ /backend/index.php [QSA]
share|improve this answer
    
Seems that your solution doesn't work, because www.domain.com points to /frontend, with your RewriteRule, Apache will try to look for /frontend/backend/index.php which doesn't exist. –  powerboy May 30 '11 at 2:58
    
Ahh OK I get it, I thought you'd rewritten / to /backend/. In that case, open your httpd.conf and put a line Alias /backend/ /full/path/to/backend/ –  sam May 30 '11 at 13:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.