开发者

.htaccess mod_rewrite to hide querystring variables into fake pathinfo

开发者 https://www.devze.com 2023-02-10 12:59 出处:网络
New to mod_rew开发者_如何学Crite under a subdirectory-esque structure.Specifically, would like to display URLs formatted like this:

New to mod_rew开发者_如何学Crite under a subdirectory-esque structure. Specifically, would like to display URLs formatted like this:

http://www.oursite.com/signup/?key=xyzabc

to this:

http://www.oursite.com/signup/xyzabc

Anyone have a quick snippet for accomplishing this? Much appreciated.


RewriteRule ^signup/([a-z]*)/?$ signup/?key=$1 [NC,L,QSA]

Will do it. All time favorit is the mod_rewrite cheat sheet v2.


Just going off of memory:

RewriteRule ^/signup/?key=(.*)$ /signup/$1 [L]
0

精彩评论

暂无评论...
验证码 换一张
取 消