Forum Moderators: phranque
1. make "mysite.com" redirect to "www.mysite.com"
I've got that covered using the following .htaccess code.
RewriteEngine On
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST}!^www\.mysite\.com [NC]
RewriteRule (.*) [mysite.com...] [R=301]
2. make www.mysite.com/test/whatever.php redirect to www.mysite.com/whatever.php
This is what I'm not sure on. I imagine it's simple, but I am having a hard time getting my head around this. I'm not a programmer, so please be patient. The reason I want to do this is that I took a test section of my site (test blog) and it is doing good and now has better PR than my homepage. So, I want to perm-redirect it to my homepage, however, there are a lot of sites linking to www.mysite.com/test/whatever....
Thanks in advance (ps. I copied the content already, so once the redirect works, there will be files to serve)
This is what I entered.
RewriteEngine On
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST}!^www\.mysite\.com [NC]
RewriteRule ^test/(.*)$ /$1 [R=301]
RewriteRule (.*) [mysite.com...] [R=301,L]
I also tried this
RewriteEngine On
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST}!^www\.mysite\.com [NC]
RewriteRule (.*) [mysite.com...] [R=301]
RewriteRule ^test/(.*)$ /$1 [R=301,L]
neither worked.
"Redirection limit for this URL exceeded. Unable to load the requested page. This may be caused by cookies that are blocked."