如何从特定网址重定向尾部斜杠
例如:
http://blabla.com/builders/anynumber1/anynumber2/anynumber3/London(any country)/
到
http://blabla.com/builders/anynumber1/anynumber2/anynumber3/London(any country)
答案 0 :(得分:0)
怎么样:
RedirectMatch 301 ^/([^/]+/[0-9]+/[0-9]+/[0-9]+/[^/]+)/$ /$1
或
RewriteEngine On
RewriteRule ^([^/]+/[0-9]+/[0-9]+/[0-9]+/[^/]+)/$ /$1 [L,R=301]
编辑: 您需要使用mod_rewrite:
RewriteRule ^([^/]+/[0-9]+/[0-9]+/[0-9]+/[^/]+)/.+$ - [L,R=404]