我需要有一個的.htaccess重寫規則重定向到一個腳本在子目錄下的根,但僅限於任何文件/在該子目錄目錄...的.htaccess重定向到腳本子目錄
/
/subdir/
/index.php
/somedir/
/anotherdir/
對於上面的結構,我希望任何瀏覽到/ subdir的人轉到/subdir/index.php,以及任何去/ subdir/somedir/to /subdir/index.php等的人...
但是,他們去根目錄。他們應該呆在那裏...我已經嘗試將一個.htaccess文件放在/ subdir中,並在重寫規則上進行了一系列的嘗試,但目前爲止沒有任何工作。
更新:我不是說只是/somedir/需要重定向OT的index.php,但/子目錄/需要的任何子目錄是重定向...腳本太多,但顯然不是/subdir/index.php
對不起,我之前並不清楚。