.htaccess mod_rewrite是否无需重定向即可重新映射? [英] .htaccess mod_rewrite remap without redirection?

查看:79
本文介绍了.htaccess mod_rewrite是否无需重定向即可重新映射?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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]

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

How can I hide the URL change? I'd like to avoid using mod_proxy, if possible.

推荐答案

只需删除,R = 302 有关内部重定向的信息,请参见: http:// httpd.apache.org/docs/2.4/rewrite/remapping.html

Simply remove the ,R=302 for an internal redirect, see: http://httpd.apache.org/docs/2.4/rewrite/remapping.html

这篇关于.htaccess mod_rewrite是否无需重定向即可重新映射?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆