我使用RewriteMatch將所有流量從subdir1重定向到subdir2,同時保持url的所有其他部分相同。因此,例如,mod_alias子目錄替換
http://www.mydomain.com/subdir1/
會重定向到
http://www.mydomain.com/subdir2/
我使用這個規則:
RedirectMatch 302 /subdir1/.* /subdir2/$1
其作品爲URL
http://www.mydomain.com/subdir1/
但不適用於任何網頁的網址較長。所以它不匹配
http://www.mydomain.com/subdir1/index.htm
應該被重定向到
http://www.mydomain.com/subdir2/index.htm
如果任何人有任何想法,我將不勝感激。