rewrite get parameters in .htaccess

强颜欢笑 提交于 2019-12-12 01:37:51

问题


Here is my website : http://www.example.com and i want to rewrite url in .htaccess here is URL : http://www.example.com/sub_portfolio.php?act=sub_cat and i want to ..

/sub_portfolio/sub_cat

i tried many rewrite condition it not worked and also check many post in our website stack overflow. like url rewrite conditions

give suggetion...


回答1:


You can easily rewrite your url using the following code.

RewriteEngine On
RewriteRule ^sub_portfolio/([A-Za-z0-9-]+)/?$ sub_cat.php?act=$1 [NC,L]

Make sure you place this code in your .htaccess file which should located in the same folder

Hope that helps



来源:https://stackoverflow.com/questions/18122936/rewrite-get-parameters-in-htaccess

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