开发者

Why redirect keeps changing address bar

开发者 https://www.devze.com 2023-02-14 20:47 出处:网络
Here is code: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_URI} !^/rt/ RewriteRule ^(.*)$ /rt/$1 [L]

Here is code:

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

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

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

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

see

http://domain.com/index.php

but open http://domain.com/开发者_Python百科rt/index.php

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


How about just using Alias?

Alias / /rt

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号