Apache RewriteRule with url parameters

社会主义新天地 提交于 2019-12-13 22:21:30

问题


1.Can I use RewriteRule with url parameters ?
Ex: www.foo.com/user/admin/?html=edit
where: html=edit used to display form to edit user profile.


2.Can I find a good docs about RewriteRule apache module.

回答1:


yes you can,

Simple add the following in your .htaccess

 RewriteEngine On 

 RewriteRule ^user/(.*)/(.*) index.php?module=user&section=$2 [L]

now in your index you'll find the get params sent as get params you can also access it via $_SERVER['REQUEST_URI']



来源:https://stackoverflow.com/questions/9754787/apache-rewriterule-with-url-parameters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!