我有以下网址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