使用mod_rewrite从URL中删除_escaped_fragment

时间:2019-03-19 15:35:14

标签: apache .htaccess mod-rewrite

我正在尝试从.htaccess文件中的网址中删除字符串“ _escaped_fragment =”。到目前为止,这是我的尝试:

RewriteCond %{QUERY_STRING} ^_escaped_fragment_=(.*)$
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI}%1 [NC,R=302,L]

这最终被无限循环调用。已成功粘贴%1中捕获的参数,但_escaped_fragment_仍显示在URL的末尾。从access.log:

::1 - - [19/Mar/2019:15:11:34 +0000] "GET /definition?_escaped_fragment_=q=retort HTTP/1.1" 302 251
::1 - - [19/Mar/2019:15:11:34 +0000] "GET /definitionq=retort?_escaped_fragment_=q=retort HTTP/1.1" 302 263
::1 - - [19/Mar/2019:15:11:34 +0000] "GET /definitionq=retortq=retort?_escaped_fragment_=q=retort HTTP/1.1" 302 275
::1 - - [19/Mar/2019:15:11:34 +0000] "GET /definitionq=retortq=retortq=retort?_escaped_fragment_=q=retort HTTP/1.1" 302 287

如何防止_escaped_fragment_出现在重写的URL中?

0 个答案:

没有答案