Apache 位置栏没有';不显示重定向的URL
这是我的Apache 位置栏没有';不显示重定向的URL,apache,mod-rewrite,httpd.conf,Apache,Mod Rewrite,Httpd.conf,这是我的httpd.conf文件http://old.example.com: RewriteEngine on RewriteBase / RewriteRule ^login$ http://another.example.com/login [L] 问题是尽管我可以重定向到http://another.example.com/login,但位置栏仍显示http://old.example.com/login 知道如何解决这个问题吗?如果在中使用mod_rewrite,则始终需要在模
httpd.conf文件http://old.example.com
:
RewriteEngine on
RewriteBase /
RewriteRule ^login$ http://another.example.com/login [L]
问题是尽管我可以重定向到http://another.example.com/login
,但位置栏仍显示http://old.example.com/login
知道如何解决这个问题吗?如果在中使用mod_rewrite,则始终需要在模式中指定完整的URL路径:
RewriteRule ^/login$ http://another.example.com/login [L,R]
仅当在每个目录上下文中使用(如在.htaccess文件中使用)时,您只需要指定相对URL路径,而不需要上下文路径前缀
并通过设置以下选项尝试显式重定向:
这样,您还可以指定状态代码:
RewriteRule ^/login$ http://another.example.com/login [L,R=301]
如果在中使用mod_rewrite,则始终需要在模式中指定完整的URL路径:
RewriteRule ^/login$ http://another.example.com/login [L,R]
仅当在每个目录上下文中使用(如在.htaccess文件中使用)时,您只需要指定相对URL路径,而不需要上下文路径前缀
并通过设置以下选项尝试显式重定向:
这样,您还可以指定状态代码:
RewriteRule ^/login$ http://another.example.com/login [L,R=301]