开发者

I want to 301 redirect a part of an url, but not the childeren of the url

For an example:

www.domain.com/part1/part2 has to be 201, but if you type www.domain.c开发者_开发百科om/part1 it has to be redirected to www.domain.com.

The normal redirect works by part2 aswell.


If you only need to redirect if there is not a second-level to the path, you should be able to use the following:

RewriteEngine on
RewriteRule part1$ / [L,R=301]

Hope this helps.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜