Redirect .html to non

RewriteEngine On
RewriteBase /

#redirect to remove the .html extension
RewriteRule ^(.+).html$ $1 [L,NC,R=301]

 

#This snippet is experimental, the above breaks some of the media library .html requests - This seems to work but still testing

 

#redirect to remove the .html extension
RewriteCond %{REQUEST_URI} !^/wp-includes
RewriteCond %{REQUEST_URI} !^/wp-admin
RewriteCond %{REQUEST_URI} !^/wp-content
RewriteRule ^(.+).html$ $1 [L,NC,R=301]

1 Comment

You must be logged in to post a comment.


  1. thank you SO MUCH! exactly what I was looking for.. it worked perfectly