Thread: 301 Redirect
View Single Post
  #10 (permalink)  
Old 12-21-2007, 04:00 PM
wige's Avatar
wige wige is online now
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,655
wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9wige RepRank 9
Default Re: 301 Redirect

I think with older versions of Apache, the RewriteEngine on directive acted as kind of a reset of the rules. The thing to remember is that {HTTP_HOST} never contains anything but the domain/subdomain. So for your second rule, where you are trying to test the requested path, that will never be contained in the host line. A request for a page on your site looks like the following:

GET /somefolder/somepage.html
Host: www.somedomain.com

To test what folder the user is requesting, you need to use the value on the GET (or if form data is being submitted, POST) line, which is in the {REQUEST_URI} variable for mod_rewrite. You also are not testing if the user is already in the /f/ folder, which is why the user gets stuck in an endless loop.
__________________
The best way to learn anything, is to question everything.
Reply With Quote