2009-01-26 43 views
0

所以我在我的web服務器上的/ blog /文件夾中有這個.htaccess文件,並且使用了我們用於這個特定客戶端(表達式引擎)的博客CMS這個.htaccess使網址搜索引擎友好。這一切都很好,除非我去www.example.com/blog/然後它通過我不想要的底部規則。.htaccess沒有正確處理文件夾的根目錄

我試着添加Google行,你可以在第二行看到它究竟是什麼檢測,它傳遞谷歌「index.html」(沒有引號) - 可能有一個簡單的正則表達式方式來排除字符串開始的index.html,但我不是一個正則表達式忍者不幸......

這裏的內容的.htaccess:

rewriteengine on 



############################## 
# BLOG CATEGORIES HOME 

rewriterule ^beach-baby/?$ index.php/site/C4/ 
rewriterule ^adventure-baby/?$ index.php/site/C5/ 
rewriterule ^snow-baby/?$ index.php/site/C6/ 
rewriterule ^wild-child/?$ index.php/site/C7/ 



############################## 
# BLOG CATEGORIES WITH PAGE NUMBER 

rewriterule ^beach-baby/page([0-9]+)/?$ index.php/site/C4/P$1/ 
rewriterule ^adventure-baby/page([0-9]+)/?$ index.php/site/C5/P$1/ 
rewriterule ^snow-baby/page([0-9]+)/?$ index.php/site/C6/P$1/ 
rewriterule ^wild-child/page([0-9]+)/?$ index.php/site/C7/P$1/ 



############################## 
# BLOG INDEX WITH PAGE NUMBER 

rewriterule ^page([0-9]+)/?$ index.php/P$1/ 



############################## 
# BLOG POST 

#rewriterule ^([^/]+)/?$ http://www.google.ca/search?q=$1 
rewriterule ^([^/]+)/?$ index.php/site/comments/$1/ 

回答

2

您可以設置其他上述以下規則來排除其他規則/index.html

RewriteRule ^index\.html$ - [L] 
+0

事實證明,我必須對index.cgi,index.pl和index.php執行相同的操作 – 2009-01-26 22:10:04

相關問題