URLからリダイレクトする必要があります:
RewriteRule ^/cars/new/(.*)/(.*)/(.*).html$ /cars/new/$1/$2/ [R=301,L]
- できます。
ただし、のようなページ/cars/new/asd/qwe/zxc.html
もこのルールでリダイレクトされます。
そして私は/cars/ new / asd / qwe /qwe.htmlのようなURLだけをリダイレクトする必要があります
そして/cars/ new / asd / some_part /some_other_part.htmlではありません
/ cars / new / asd / some_part /some_part.htmlのみ
何か提案をお願いします!
更新:有効なソリューションは
RewriteRule ^cars/new/(.*)/(.*)/\2.html$ /cars/new/$1/$2/ [R=301,L]