httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Dixon <>
Subject Re: [users@httpd] Apache Rewrite Rule for root directory
Date Fri, 13 Apr 2007 11:43:52 GMT
Perhaps this is what you want. I assume you are not serving the abc and 
xyz domains from virtual servers on one machine. I have allowed you 
might have more than one domain hosted on the xyz server. If not, you 
can support very old browsers better by omitting the hostname conditioning.

RewriteEngine On
RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^*)
RewriteRule .* [R=permanent,L]

If you want the operation to be unnoticeable to your users, you will 
need to reverse proxy through to, but be 
aware there are complications with cookie domains and paths, and more 
with https. It would work something like this, using mod_proxy and 
mod_rewrite in Apache 2.2.4 Any absolute links in your developed pages 
will need rewriting by the reverse proxy server.

RewriteEngine On
RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^*)
RewriteRule .* [P]


DBAS wrote:

>We want to use URL to access internet pages developed under
>server eg,
> and etc...
>as, and
>The only way we have been able to do this to date is using the following
>rewrite rules
><VirtualHost *:7779>
>    ServerName
>    Port 80
>    RewriteEngine On
>   RewriteOptions inherit
>    # Project Pages
>    Redirect /index.html
>    RewriteRule ^/page1*$ /test/page1 [PT,L,NC]
>    RewriteRule ^/page2*$ /test/page2 [PT,L,NC]
>    # Project Folders
>    RewriteRule ^/graphics/(.*)$ /test/graphics/$1 [PT,L,NC]
>    LogLevel warn
>Can anyone suggest an easier way to do this please?
>Assistance is much appreciated.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message