2009-01-26 106 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

相关问题