2011-06-14 21 views
1
  • 轉換大的靜態網站 的Drupal 6.2
  • 現在
  • 網頁網址的別名,如 「文件夾/」 「文件夾/子文件夾/」
  • 問題是數百 入站鏈接指向 「sub.example.com/folder/index.htm」

我寧願沒有包括在我的別名文件名,並希望我可以htaccess的重寫這些請求到基本目錄因爲它們都是相同的格式,但我不能爲我的生活得到它的工作。的.htaccess刪除的index.htm的請求上的Drupal 6網站

一直試圖利用這一點,前置於Drupal的重寫規則在.htaccess:

RewriteCond %{THE_REQUEST} ^GET\ /.*/index\.(php|html)\ HTTP 
RewriteRule (.*)index\.(php|html)$ /$1 [R=301,L] 

或本:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.(html|php)?\ HTTP/ 
RewriteRule ^(([^/]+/)*)index\.(html|php)?$ http://sub.example.com/$1 [R=301,L] 

回答

0

嗯,我覺得愚蠢,以爲我已經用L試了一下, R交換,但我想不是,這對我嘗試的兩個位都很合適。

RewriteCond %{THE_REQUEST} ^GET\ /.*/index\.(php|html)\ HTTP 
RewriteRule (.*)index\.(php|html)$ /$1 [L=301,R]