2012-04-05 25 views
1

所以我有以下.htaccess文件內容從我的其他項目可訪問http://www.example.com/讓index.php在目錄內捕獲所有的URL?

Options -MultiViews 

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase/
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule . /index.php [L,NC,QSA] 
</IfModule> 

現在上述工作很好,但現在我有一個新問題。我想使用相同的概念(將所有鏈接重定向到index.php),但是這次它需要位於一個目錄中。 (例如http://www.myothersite.com/thisfolder/

所以我試圖在http://www.myothersite.com/thisfolder/裏面創建一個.htaccess文件。問題是,我如何修改上面的代碼,使其指向thisfolder內的index.php的所有鏈接?

僅供參考請看下圖:

myothersite.com 
'-> thisfolder 
     '-> .htaccess 
     '-> index.php 

我需要將.htaccess文件放在裏面thisfolder,因爲我不希望它與我在其他文件夾中的其他項目搞亂做。我想保留http://www.myothersite.com/thisfolder/以內的所有操作。

任何人都可以幫我嗎?

回答

1

你試過了嗎?

RewriteRule . /thisfolder/index.php [L,NC,QSA]

相關問題