0
我已經改變了我的CMS,需要寫一個mod_rewrite規則來幫助重定向一些舊的URL。試圖寫一個mod_rewrite規則
我想要做的是:
- 刪除 「博客/檔案」
- 用破折號代替下劃線
- 替代名 「.html」 以斜線
舊鏈接:
http://example.com/blog/archives/the_post_title.html
新的鏈接
http://example.com/the-post-title/
爲了解決1 & 3我想沿着這可能工作線的東西,但它不是。
RewriteRule ^/blog/archives/([A-Za-z0-9-]+)/?.html$ $1 [L]
感謝您的建議。
感謝您的開始。我寫了:'RewriteRule ^([^ _] *)_([^ _] * _。*)$ 1- $ 2 [N] \t RewriteRule ^([^ _] * )$/$ 1- $ 2 \t RewriteRule ^/blog/archives /(.*?)。html $/$ 1/[L,R = 301]' –