我阅读了很多关于完整域的 301 重定向的内容,但无法了解如何将现有路径准确更改为新路径。
下面是一个例子:
site.com/cars到site.com/motobikes
和:
site.com/cars/tires到sote.com/motobikes/(变量,例如柏林、巴黎)/tires
我怎样才能完成这个任务?
试试这个:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule ^cars http://example.com/motorbikes [R=301,L]
和:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule ^cars/tires http://example.com/motobikes/berlin/tires [R=301,L]
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句