httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jos...@slive.ca>
Subject Re: [users@httpd] Rewrite Syntax ?
Date Fri, 12 Sep 2003 15:50:32 GMT

On Fri, 12 Sep 2003, Timothy Stone wrote:

> I have a virtual host block defined as follows:
>
>   1 NameVirtualHost *
>   2
>   3 <VirtualHost *>
>   4   ServerName www.harrisburgevents.com
>   5
>   6   RewriteEngine on
>   7
>   8   RewriteCond %{HTTP_HOST} ^www\.harrisburgevents\.com$ [nocase]
>   9   RewriteRule ^/(.*)       http://www.harrisburgpa.gov/parksRec/$1
> [L,R=permanent]
> 10
> 11   RewriteLog      logs/rewrite_dpr.log
> 12   RewriteLogLevel 0
> 13
> 14 </VirtualHost>
>
> The purpose of this Rewrite is to say, "You requested host
> 'www.harrisburgevents.com' but it has moved, permanently, to
> 'www.harrisburgpa.gov/parksRec'".
>
> Is the RewriteCond on line 8 even necessary? Could I just state the
> RewriteRule?

No, the RewriteCond is not necessary since the <VirtualHost> scope
is already enforcing that.

In fact, the standard config to do this is simply
<VirtualHost *>
ServerName www.harrisburgevents.com
RedirectPermanent / http://www.harrisburgpa.gov/parksRec/
</VirtualHost>

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message