.htaccess redirect without changing address bar

不羁岁月 提交于 2019-11-27 08:17:58

If you are using the R flag you are telling mod_rewrite that an external redirect is what you want, therefore the browser is asked to make a new request and the address bar should change accordingly.

Without the R flag, there is no redirect, but an Apache-internal request rewrite which is hidden from the browser. Thus, the address bar won't change. However, you cannot use internal redirects to external URIs for obvious reasons.

Since you seem to use an internal redirect anyway, just remove the R flag and it should work:

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.+)$ ?url=$1 [L]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!