How to do this redirect?
I want to 301 redire开发者_StackOverflow中文版ct all the link from
http://www.mysite.com/my-color/whatever/
to
http://www.mysite.com/my-color/
htaccess:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.mysite\.com$
RewriteRule ^my\-color\/\/?(.*)$ "http\:\/\/www\.mysite\.com\/my\-color\/$1" [R=301,L]
This throws me in a loop ad can't seem to figure it out... Do you have any pointers ? Thank you! :)
Try changing your (.*)
to (.+)
. That way it won't match the empty string.
精彩评论