httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Nichel <>
Subject Re: [users@httpd] mod rewrite redirect if NOT in URL
Date Tue, 25 Apr 2006 17:21:48 GMT
Joshua Slive wrote:
> On 4/25/06, John Nichel <> wrote:
>> Hi, I usually have no problem redirecting based on what is in the URL,
>> but now I'm trying to redirect all pages in a site to one page on the
>> same site. I have to exclude that one page from the redirection process
>> else I get an infinite loop. I've tried numerous combinations of the
>> following, but I can't see to get it to work....
>> RewriteCond %{SCRIPT_FILENAME} !^redirect\.html [NC]
>> RewriteRule ^/$ /redirect.html
>> Basically, if the URL doesn't contain 'redirect.html', redirect to
>> redirect.html
> (I suspect your example is off, since the RewriteRule above will not
> create a loop; it only addresses one URL.)
> Use the RewriteLog to figure out what is going wrong.
> Either of these should work:
> RewriteCond %{Request_URI} !^/redirect\.html [NC]
> ...
> or
> RewriteRule ^/redirect\.html - [L]
> Joshua.

Hi Joshua,  thanks for the response.  Unfortunately it doesn't seem to 
be working for me.  Right now I have this :

RewriteEngine On
RewriteBase /
RewriteCond %{Request_URI} !^/redirect\.html [NC]
RewriteRule ^/$ /redirect.html

And none of the pages I go to on the site get redirected.  I set up the 
rewrite log, and nothing is being entered into there (tailing it).  To 
ensure that Apache was executing my .htaccess file, I put some bogus 
code in it and it thru an error, so that part's working.

John C. Nichel IV
Dot Com Holdings of Buffalo

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