我在 htaccess 中為 Wordpress 使用了以下重定向規則,這似乎有效:
RewriteCond %{REQUEST_URI} /nl/my-impact/
RewriteRule ^nl/(. )$ $1nl/ [R=301,L]
但它應該重定向兩者:
https://alivetoearth.org/nl/my-impact/florianhttps://alivetoearth.org/nl/my-impact/florian/
至:
https://alivetoearth.org/my-impact/florian/nl/
我怎樣才能確保它在這兩種情況下都有效?
現在我可以讓它在其中一個或另一個中作業。如果有更好的方法來撰寫整個重定向,我也很想知道。
uj5u.com熱心網友回復:
您可以使用此重定向規則:
RewriteRule ^(nl)/([^/] /[^/] )/?$ /$2/$1/ [R=301,L,NC]
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/484598.html
標籤:正则表达式 WordPress .htaccess 重定向
