RewriteRule that preserves GET parameters

后端 未结 3 1512
-上瘾入骨i
-上瘾入骨i 2020-11-30 13:14

What is wrong with this rewrite rule?

RewriteRule ^api/(.+)$ api/index.php?url=$1 [L]

I simply want \"index.php?url=\" to be added after ap

3条回答
  •  时光说笑
    2020-11-30 13:39

    The regex on the RewriteRule is only run against the path part of the URL, not the query parameters. Fortunately there is the [QSA] flag to preserve existing query parameters.

提交回复
热议问题