动态补丁重定向301



嗨,我在htaccess中尝试了各种mod_rewrite方法,但都不起作用。我需要为来自https://somesite.net/cars/truck/123-volvo-truck.html的url动态重定向301至https://somesite.net/cars/123-volvo-truck.html

补丁carstruck需要是动态的。

我无法为此构建程序。谢谢

Options All -ExecCGI -Indexes -Includes +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{ENV:HTTPS} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /index.php HTTP/
RewriteRule ^index.php$ https://somesite.net/ [R=301,L]
RewriteCond %{THE_REQUEST} //
RewriteRule .* /$1 [R=301,L] 
RewriteRule ^([^.]+)/([0-9]+)([0-9]+)(.*).html$ $1/$3.html [L] -- tried this last time
</IfModule>

请将此作为您的最后一条重定向规则:

RewriteRule ^([^/]+)/[^/]+/(d+-.+.html?)$ /$1/$2 [R=301,NC,L,NE]

最新更新