开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜