问题
I'm using the following to redirect http://example.com/somedir/?_escaped_fragment=key=val to 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]
How can I hide the URL change? I'd like to avoid using mod_proxy, if possible.
回答1:
Simply remove the ,R=302 for an internal redirect, see: http://httpd.apache.org/docs/2.4/rewrite/remapping.html
来源:https://stackoverflow.com/questions/31649101/htaccess-mod-rewrite-remap-without-redirection