1
這是我原來的鏈接htaccess的規則不起作用
http://localhost/xx/xx/public_html/news.php?id=7
我想將其更改爲
http://localhost/xx/xx/public_html/news-7-TitleOfNews.html
,這裏是我的htaccess
Options -Indexes
ErrorDocument 404 www.site.com/404.html
RewriteEngine On
RewriteRule ^news-([0-9]*)(?:-([0-9a-zA-Z*]))?(?:\.html)?$ news.php?id=$1 [L]
,但它不工作(重定向到404頁)
你有服務器上的'Mod_rewrite'激活嗎? – Disa