Apache2 rewrite with query string escaped twice

后端 未结 1 746
青春惊慌失措
青春惊慌失措 2021-02-06 04:06

Using this rule in a virtual host configuration file leads to double escaping of the query parameters:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*)         


        
相关标签:
1条回答
  • 2021-02-06 05:03

    Try to add the [NE] (noescape) tag at the end of the rewrite rule:

    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [NE]
    

    This happens because & and ? and some others are escaped by default in the rewrite process.

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