Thread: 301 Redirect
View Single Post
  #7 (permalink)  
Old 12-21-2007, 11:07 AM
wige's Avatar
wige wige is offline
Moderator
WebProWorld Moderator
 
Join Date: Jun 2006
Location: United States
Posts: 2,651
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

Two things. First, you are combining two redirects that need to be seperate, second, do you actually have sub-subdomains?

RewriteEngine On
# First, force everything to the www. subdomain
RewriteCond %{HTTP_HOST !^(.*)\.mysite\.com$
RewriteRule ^(.*)$ http://www.mysite.com/ [R=301, L]
# Then rewrite all requests so that they go to the /f/ folder.
RewriteCond %{REQUEST_URI} !^/f/
RewriteRule ^/(.*)$ http://www.mysite.com/f/$1 [R=301, L]
__________________
The best way to learn anything, is to question everything.
Reply With Quote