httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Axel-St├ęphane SMORGRAV <>
Subject RE: [users@httpd] redirect debacle
Date Thu, 13 Apr 2006 06:12:38 GMT
Make sure you have loaded mod_rewrite.

If you really need the client to request a specific host name (because you are using named
virtual hosts), you can put the following lines in the appropriate virtual host:

RewriteEngine On
RewriteCond %{HTTP_HOST} 
RewriteRule .* [R] 

If you want to have fun, you can also make a more general rule that redirects any request
to your site with a host name other than, to wilkinson using the host
name as first element of the path:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^\.]+) 
RewriteCond %1 !=wilkinson
RewriteRule .* [R] 

No Redirect directive required. The one suggested would redirect all requests for the root
path to wilkinson, and would most probably result in a redirect loop.


-----Original Message-----
From: Paul Constantine [] 
Sent: Thursday, April 13, 2006 2:15 AM
Subject: Re: [users@httpd] redirect debacle

Perhaps you could give me some hints for doing this with mod_rewrite, if you have previous
experience? It looks quite involved.

Thanks again,

>From: "Kishore Jalleda" <>
>Subject: Re: [users@httpd] redirect debacle
>Date: Wed, 12 Apr 2006 19:05:08 -0400
>I guess you need the Rewrite directive for what you are trying to 
>acheive, as far as the syntax for Redirect goes
>                             Redirect [status] URL-path URL
>notice that the second argument is a URL-path which is supposed to be 
>PATH (absolute or relative), and not a URL like you defined.
>There are two walk arounds for this
>1) Go into the config section of, and do this
>Redirect permanent    /
>2) Or use Mod_Rewrite to rewrite the URL

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