0
如何在Apache中使用mod_rewrite
完成以下URL重寫?在URL重寫中使用破折號替換斜線
- 漂亮鏈接:
www.mysite.com/pages/category/page/
- 實際文件:
www.mysite.com/html/category-page.html
我只想重寫URL是否含有域和pages
目錄。在所有其他情況下,我希望服務器正常工作。
我已經想出了這一點,但想知道如何與破折號替代斜線:
RewriteEngine On
#Look for the word "pages" followed by a slash, and then the article title
RewriteRule ^pages/(.+)$ html/$1.html [L]