301重定向和URL级联重定向、级联、URL

2023-09-02 09:59:07 作者:空城空心盼一人@

我需要做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]
 
精彩推荐
图片推荐