.htaccess - hide php get variables [closed]

2019-09-21 23:32发布

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条回答
家丑人穷心不美
2楼-- · 2019-09-22 00:03

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

RewriteModule On
RewriteRule ^(.*)/(.*)/(.*)$ /$1/$2?var=$3
查看更多
登录 后发表回答