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]