【问题标题】:.htaccess mod_rewrite remap without redirection?.htaccess mod_rewrite 重映射没有重定向?
【发布时间】:2015-07-28 20:46:09
【问题描述】:

我正在使用以下内容将http://example.com/somedir/?_escaped_fragment=key=val 重定向到http://example.com/somedir/static/?key=val

RewriteBase /
RewriteCond %{REQUEST_URI}::$1 ^(.*?/)(.*)::\2$
RewriteRule ^(.*)$ - [E=BASE:%1]
RewriteCond %{QUERY_STRING} ^_escaped_fragment=(.*)$
RewriteRule ^(.*)$ %{ENV:BASE}static/?%1 [L,R=302]

如何隐藏 URL 更改?如果可能,我想避免使用 mod_proxy。

【问题讨论】:

    标签: apache .htaccess mod-rewrite


    【解决方案1】:

    只需删除 ,R=302 即可进行 internal 重定向,请参阅:http://httpd.apache.org/docs/2.4/rewrite/remapping.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-30
      • 1970-01-01
      • 2019-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-06
      • 1970-01-01
      相关资源
      最近更新 更多