.htaccess - hide php get variables [closed]

三世轮回 提交于 2019-12-13 09:53:46

问题


I have a webpage that I would like to rewrite the URL to. However, after about 1 hour of searching on Google and here, I couldn't find anything that made since to me, therefore, wouldn't work.

Current Website: www.example.com/page1/page2?var=1

I want that changed to www.example.com/page1/page2/1

Any help will be appreciated!

Thanks,

ZG


回答1:


Do you always have two components in the URI? If so, create an .htaccess file like this:

RewriteModule On
RewriteRule ^(.*)/(.*)/(.*)$ /$1/$2?var=$3


来源:https://stackoverflow.com/questions/14415685/htaccess-hide-php-get-variables

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