2014-03-03 203 views
0

當用戶導航到http://domain.com時,我想指定他們正在提取哪個子文件夾的index.php。這將每隔幾個月更改一次,因爲它是一個出版物(so/issue-1 /,/ issue-2 /等等)。使用htaccess指定新的根目錄

下面是我在我的.htaccess文件至今:

DirectoryIndex /issue-2/index.php 

它不工作。

回答

1

我會這樣做,試試看。

RewriteEngine on 
RewriteCond %{HTTP_HOST} ^domain.com$ [NC,OR] 
RewriteCond %{HTTP_HOST} ^www.domain.com$ 
RewriteCond %{REQUEST_URI} !folder/ 
RewriteRule (.*) /folder/$1 [L] 
相關問題