[英]Removing “/” and “-” by 301 redirect via htaccess
301將此重定向:
example.com/AnythingHere/-/AnythingHere.html
至:
example.com/AnythingHere/AnythingHere.html
注意: AnythingHere
表示任何數字/字母/破折號/下划線。
嘗試了這個但是沒有用:
RewriteRule (.*)/(.*)-(.*)\.html$ (.*)/-/(.*)-(.*)\.html$
您可以使用RedirectMatch:
RedirectMatch 302 ^/(.+)/-/(.+)\.html$ http://example.com/$1/$2.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.