301重定向和URL级联 [英] 301 redirects and url concatenation
本文介绍了301重定向和URL级联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要做301重定向的100多个URL,这样不知道是否有可能使用串联的URL,这样我就不必在每一种类型。
I need to do 301 redirects on 100+ urls so was wondering if it's possible to use concatenation on the urls so that i don't have to type in every single one.
示例URL将类似于以下内容:
Sample urls would be similar to the following:
www.mysite.co.uk/ThisCategory/ThisSubCategory/reviews
www.mysite.co.uk/AnotherCategory/AnotherSubCategory/reviews
www.mysite.co.uk/YetAnotherCategory/YetAnotherSubCategory/reviews
我敢肯定有一种方法,只是采取任何网址开头www.mysite.co.uk/和/审查结束,但我不明白。
I'm sure there is a way to just take any url beginning with www.mysite.co.uk/ and ending in /reviews but i can't figure it out.
推荐答案
将下面的的htaccess
在根级:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.mysite.co.uk$ [NC]
RewriteRule ^(.*)/reviews/?$ http://new-web-page [R,L]
这篇关于301重定向和URL级联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文