1

Whenever I type a made up address that includes a directory index it removes it. The problem is when the the address includes a forbidden subdirectory. It reduces itself until it hits forbidden. How do I get it to redirect to the homepage instead of reducing itself?

Options -Indexes +FollowSymlinks -MultiViews

RewriteEngine on

DirectoryIndex index.htm index.html index.php

# REDIRECT www to non-wwww
# Set Canonical URL
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

# REMOVE Directory Index From URL
RewriteRule ^([a-zA-Z0-9_-]+/)?index\.(htm?|html?)$ /$1 [R=301,L]

# Custom Error Documents
ErrorDocument 404 /errors/404_notfound.htm
user25687
  • 11
  • 1
  • Hi, welcome to SO. Please don't multi-post across the Stack Exchange network, [Pro Webmasters](http://webmasters.stackexchange.com/questions/50556/is-my-htaccess-rule-creating-an-infinite-loop) is probably the preferred site for .htaccess questions (where you have already asked this question). – MrWhite Jul 09 '13 at 22:59

0 Answers0