Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Assuming i have the following project structure

- Frontend
-- index.php
- Backend
-- index.php

I want my to use /www/root/frontend as the document root while /www/root/backend to be the document root if was requested. Note: Alias does exact match with /admin/ while i need /admin/* to work for the second case.

How should i go about this?


share|improve this question

In your Apache virtualhost config

RewriteEngine On
RewriteCond %{REQUEST_URI} ^admin [NC]
RewriteRule ^(.*)$ /www/root/backend/$1 [L]

So in context

<VirtualHost *:80>

  DocumentRoot /www/root/frontend

  RewriteEngine On
  RewriteCond %{REQUEST_URI} ^admin [NC]
  RewriteRule ^(.*)$ /www/root/backend/$1 [L]
share|improve this answer

Your Answer


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.