Mod Rewrite and Using PHP's GET for URL's When not Following the Rules

后端 未结 1 1132
独厮守ぢ
独厮守ぢ 2020-12-21 21:34

I couldn\'t think of a good title for this, it\'s hard to explain. Basically, I have mod_rewrite setup on my server. It turns each ?a=1&b=2&c=3 etc into /1/2/3

相关标签:
1条回答
  • 2020-12-21 22:01

    The QSA directive is probably what you're looking for:

    'qsappend|QSA' (query string append)
    This flag forces the rewrite engine to append a query string part of the substitution string to the existing string, instead of replacing it. Use this when you want to add more data to the query string via a rewrite rule.

    E.g.,

    RewriteRule ^something/([0-9]+)$ something.php?id=$1 [QSA]
    

    Will let something/9?key=val go to something.php?id=9&key=val

    0 讨论(0)
提交回复
热议问题