.htaccess how to Strip out index.html out of WordPress Directory

This works for any wordpress directory.

If you have a WordPress website and have noticed that google have indexed your site with index.html or a plugin has added it. Example would be http://pinguisweb.com/about/index.html. The code below will redirect to http://pinguisweb.com/about/ and drop index.html

try adding

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^index\.html$ / [R=301,L]
RewriteRule ^(.*)/index\.html$ /$1/ [R=301,L]
# add a trailing slash to /wp-admin
RewriteRule ^(+/)?wp-admin$ $1wp-admin/ [R=301,L]

to your .htaccess file

WordPress htaccess redirect subdirectory to url


This will redirect all references to car sales directory to 
the Car-Sales file. 

RedirectMatch 301 ^/Car-Sales/.*$ http://pinguisweb.com/car-sales/