views:

222

answers:

1

So I have this .htaccess file in the /blog/ folder on my webserver and to work with the blog CMS we are using for this particular client (Expression Engine) I wrote this .htaccess to make the URLs SEO friendly. It all works great unless I go to www.example.com/blog/ then it goes through to the bottom rule which I don't want it to.

I tried adding that Google line you can see on the 2nd last line to see what exactly it was detecting and it passes google "index.html" (no quotes) -- there's probably a simple regex way to disclude strings that start with index.html but I'm not a regex ninja unfortunately...

Here's the .htaccess contents:

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  A: 

You could set the following rule above the others to exclude /index.html from the other rules:

RewriteRule ^index\.html$ - [L]
Gumbo
turns out I had to do the same for index.cgi, index.pl, and index.php
Andrew G. Johnson