为什么重定向不断改变地址栏 [英] Why redirect keeps changing address bar

查看:236
本文介绍了为什么重定向不断改变地址栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是code:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/rt/
RewriteRule ^(.*)$ /rt/$1 [L]
</IfModule>

有没有[R],但不断变化的地址栏的位置。 它集重定向302 ...

There is no [R], but it keeps changing address bar location. It set redirect 302...

我需要改变的根文件夹/ RT /文件夹,但没有在地址栏中改变位置。 .htaccess文件旁边,我不能使用任何东西......

I need to change root folder to /rt/ folder, but without changing location in address bar. I can't use anything beside .htaccess file...

我希望用户在访问: http://domain.com/index.php

I want users when visit: http://domain.com/index.php

http://domain.com/index.php

但开放 http://domain.com/rt/index.php

这是index.php的示例文件,我需要这个工作的每一个文件... 如果没有在浏览器地址栏中改变位置...

This index.php is example file, I need this working for every file... Without changing location in browser address bar...

推荐答案

如何只使用别名

Alias / /rt

如果没有,请确保您有mod_proxy的启用,并尝试这样的:

If not, make sure you have mod_proxy enabled, and try this:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/rt/
    RewriteRule ^(.*)$ /rt/$1 [PL]
</IfModule>

这篇关于为什么重定向不断改变地址栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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