我有以下網址http://www.example.com/teams.php?team_id=12
我希望這個網址是http://www.example.com/teams-pavilion-boys-varsity-soccer
隱藏PHP擴展使用的.htaccess URL重寫
我曾嘗試下面的代碼
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^teams-([0-9a-zA-Z]+)\.html$ teams.php?team_id=$1
請幫助我。
在此先感謝
而不是「請幫助我」你可能已經解釋瞭如何的事情它行爲不端,或者你在絆腳石。 (猜測不完整的charclass /缺少url後綴,並期望從字符串中實現數字id。) – mario
當您嘗試使用代碼時發生了什麼?換句話說,「什麼不工作」? – Havelock
可能重複的[RewriteRule不會在.htaccess文件中工作](http://stackoverflow.com/questions/11354509/rewriterule-will-not-work-in-htaccess-file) – mario