问题
I want to redirect http://www.example.com/myfolder/dir1
to http://www.example.com/myfolder/dir2
.
But I want to use .htaccess
in dir1 i.e. http://www.exmaple.com/myfolder/dir1/.htaccess
.
回答1:
Place this this rule as 1st rule in /myfolder/dir1/.htaccess
:
RewriteEngine On
RewriteBase /myfolder/dir1/
RewriteRule ^(.*)$ /myfolder/dir2/$1 [L,R]
来源:https://stackoverflow.com/questions/22113393/redirect-a-content-of-the-directory-to-another-directory-in-parent-folder