我想将我的URL缩写为:
localhost/group.php?(GET_REQUEST_VARIABLE_HERE) 至
localhost/(GET_REQUEST_VARIABLE-VALUE)从本质上讲,它是这样的:
localhost/group.php?id=7 TO localhost/7我正在使用PHP,我猜我需要一个htaccess文件。
发布于 2015-06-04 12:23:50
这个问题已经被回答了数百次,我已经建议你在你的帖子的评论中阅读更多关于它的内容。
顺便说一句,这个.htaccess应该没问题
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1
RewriteRule ^(.*)$ group.php?id=$1 [L,QSA] 记住:
后重新启动apache
要安装apache重写模块,请使用命令a2enmod rewrite。要重新启动apache,请使用sudo service apache2 restart
请先阅读http://www.workingwith.me.uk/articles/scripting/mod_rewrite你不想配置一个htaccess错误是web开发人员生活中最糟糕的事情之一:O :( ..
https://stackoverflow.com/questions/30568248
复制相似问题