2012-02-16 122 views
0
Options +FollowSymLinks 
RewriteEngine On 

RewriteRule ^files/(.*) files/index.php 

RewriteCond %{HTTP_HOST} ^domain\.com$ [NC] 
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] 

我試圖重寫文件目錄的index.php這也是在文件目錄的一切。該頁面顯示,但始終給出500錯誤,任何人都可以幫助我嗎?重寫規則給出了500錯誤

回答

0

以相同的順序操作:在我的文件

Options +FollowSymLinks 
RewriteEngine On 

RewriteCond %{ENV:REDIRECT_STATUS} 200 
RewriteRule^- [L] 

RewriteCond %{HTTP_HOST} ^domain\.com$ [NC] 
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] 

RewriteCond %{REQUEST_URI} ^/files [NC] 
RewriteRule ^(files)/.* $1/index.php [L] 
+0

完美的作品,我也是固定的東西,但你的代碼運行完美,非常感謝你! – 2012-02-16 19:44:27

+0

@NicholasEvm歡迎 – ThinkingMonkey 2012-02-16 19:48:42