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 -MultiViewsRewriteEngine onDirectoryIndex index.htm index.html index.php# REDIRECT www to non-wwww# Set Canonical URLRewriteCond %{HTTP_HOST} !^www\.RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]# REMOVE Directory Index From URLRewriteRule ^([a-zA-Z0-9_-]+/)?index\.(htm?|html?)$ /$1 [R=301,L]# Custom Error DocumentsErrorDocument 404 /errors/404_notfound.htm
Is my .htaccess rule creating an infinite loop?
apache;htaccess;mod rewrite