How do I preserve the existing query string in a mod_rewrite rule

后端 未结 2 769
北海茫月
北海茫月 2020-12-11 07:40

I\'m trying to rewrite an url from:

http://domain.com/aa/whatever/whatever.php
to
http://domain.com/whatever/whatever.php?language=aa

However, de

2条回答
  •  半阙折子戏
    2020-12-11 08:09

    You could setup the URL rewrite to pass the language to the php script via the PATH_INFO element of the $_SERVER superglobal. Just pass the language to the script like so:

    foobar.php/en?args
    

    In this case, $_SERVER[PATH_INFO] would equal /en

提交回复
热议问题