httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrea Rossignoli <>
Subject Re: [users@httpd] In Rewrite Loop -- please help
Date Thu, 11 Sep 2003 19:15:44 GMT
> Your notes on the working configuration were excellent. My original work 
> is based on a novice understanding of mod_rewrite culled from a diverse 
> collection of resources. But "it worked" and trying to fix it proved out 
> common sense, "if it isn't broken, do not fix it." :D I reversed my 
> changes and let the working, less than perfect, configuration stand.
THat's not a problem,
in fact my aim was to show a different way to do that ;)

> I do have some questions on your notes however, if you will indulge me. :)
I'm all ears :)

>> Again you need to add a $ (``end of string''') because
>> ^www\.mycity\.com
>> will match
>> but , etc too
>> ^www\.mycity\.com$ will only match
> Regarding the end of string anchor ($), it makes sense, and I avoided 
> using it for I have not seen it used in the examples and documentation I 
> consulted originally 
> ( Do you 
> think that adding the end of string anchor will effect the RewriteCond 
> dramatically?
Personally I only see benefits of using the $.
I don't think you will have troubles adding it,
maybe you won't have troubles removing it but it's more correct
to add it.
For example is a valid extension,
don't using the $ will consider at the same way as and that's not good.

> In the second virtual host (from the working configuration):
>>> <VirtualHost *>
>>>     ServerName
>>>     ServerAlias  *
>>>     DocumentRoot "C:/usr/local/apache2-01/htdocs/mycity"
>>>     RewriteEngine on
>>>     RewriteCond %{HTTP_HOST} ^ [nocase]
>>>     RewriteRule ^/(.*) [R=permanent]
>>>     RewriteLog logs/rewrite_rec.log
>>>     RewriteLogLevel 9
>>> </VirtualHost>
>> Nope, I don't think this works.
>> You will create an infinite 30x redirection loop.
>> SO I think you will have to use:
>> #etc
>> RewriteEngine on
>> RewriteCond %{HTTP_HOST} !^www\.mycityevents\.com$ [nocase]
>> RewriteRule ^/(.*) [R=permanent]
>> #*********WORKING, modified: end
>> I added a ! to avoid the ad-infinitum 30x loop 
> The use of:
> RewriteCond %{HTTP_HOST} ^ [nocase]
> is intentional because this actually represents a website that has been 
> folded into content that exists on the domain at
> I'm trying to say to the client, "You just asked for 
> '', but the content is found instead at 
> ''." Does this make more sense? Again, as is, the 
> configuration works.
mmm I see, but there you are redirecting to
and not to
That's why it sounded me weird, am I right ?
A typo ?

> I'm not afraid of mod_rewrite, but it is a daunting beast.
I agree :D.

Mr Andrea

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