我需要更改網址:
http://example.com/*/a/any.html
http://example.com/*/b/any.html
http://example.com/*/c/any.html
到:
http://example.com/a/any.html
http://example.com/b/any.html
http://example.com/c/any.html
如果直接訪問:
http://example.com/a/any.html
http://example.com/b/any.html
http://example.com/c/any.html
保持這種方式
提前感謝大家的幫助
uj5u.com熱心網友回復:
如果/subdir是您需要洗掉的子目錄,那么您可以.htaccess在現有 WordPress 指令之前,在根檔案頂部嘗試類似以下內容:
RewriteRule ^subdir(/(a|b|c)/[\w-] \.html)$ $1 [R=302,L]
如果子目錄實際上是任何子目錄,請嘗試以下操作:
RewriteRule ^[^/] (/(a|b|c)/[\w-] \.html)$ $1 [R=302,L]
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/400856.html
下一篇:處理bash腳本中的特殊字符
