HIII,定期htaccess的URL重寫表達
我想重寫目錄www.mysite.com/index.php?category=news 到www.mysite.com/news 我寫這篇文章的代碼,但其不工作 任何人都可以幫助,請 感謝您的幫助
RewriteEngine On
RewriteRule ^([a-zA-Z0-9-/]+)$ index.php?category=$1
感謝所有誰回答我的問題,所有的代碼都工作時,我嘗試寫www.mysite.com/news,但我的意思是當我點擊鏈接 「a href ='index.php?category = news'」link「/ a」我想成爲r馬上寫入www.mysite.com/news
會發生什麼事,當你去http://www.mysite.com/news? –
我相當肯定你的意思是「重寫'news'到'index.php?category = news'」而不是其他方式 – Phil
levi Morrison,它的作品,但我的意思是當我點擊一個鏈接「a href =' index.php?category = news'「link」/ a「我想立即改寫爲www.mysite.com/news –