Forum Moderators: mack
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*index\.html? [NC]
RewriteRule ^(([^/]*/)*)index\.html?$ http://www.domain.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.domain\.com [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html? [NC]
RewriteRule ^(([^/]+/)*)index\.html?$ http://example.com/$1 [R=301,L,NC]
RewriteCond %{HTTP_HOST} !^(example\.com)?$
RewriteRule (.*) http://example.com/$1 [R=301,L] [edited by: brotherhood_of_LAN at 10:35 pm (utc) on May 7, 2012]
[edit reason] updated code on poster's request [/edit]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html? [NC]
RewriteRule ^(([^/]+/)*)index\.html?$ http://example.com/$1 [R=301,L,NC]
RewriteCond %{HTTP_HOST} !^(example\.com)?$
RewriteRule (.*) http://example.com/$1 [R=301,L] Options +FollowSymLinks
RewriteEngine on
RewriteBase /
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html? [NC]
RewriteRule ^(([^/]+/)*)index\.html?$ http://example.com/$1 [R=301,L,NC]
#
RewriteCond %{HTTP_HOST} !^(example\.com)?$
RewriteRule (.*) http://example.com/$1 [R=301,L]
#
RewriteCond %{SERVER_PORT} =443
RewriteCond %{REQUEST_URI} !folder/
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
#
RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^robots.txt$ robots_ssl.txt