1
我有网站http://example.com/~myhome/
。我想临时将http://example.com/~myhome/dir1/
重定向到http://example.com/~myhome/dir2/
。重定向规则不适用于htaccess中的index.php
我写了下面行我.htaccess
这是dir1
RewriteEngine On
Redirect 302 /~myhome/dir1/ http://example.com/~myhome/dir2/
Redirect 302 /~myhome/dir1/(.*) http://example.com/~myhome/dir2/$1
问题里面有这个代码是,这是在dir1/
每个文件重定向到dir2/
正确,但index.php
被重定向到http://example.com/dir2/index.php
。
不,这是行不通的。是的,浏览器缓存了旧的301重定向。我清除了缓存,我的代码工作。 – Dheerendra