/ Published in: Apache
                    
                                        
This rewrite will not work on WordPress.  It forces .htm and .html files that no longer exist to go to the new .php versions of the pages.
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L]
RewriteRule ^(.*)\.htm /$1.php [R=301,L]
RewriteRule ^(.*)\.html /$1.php [R=301,L]
Comments
 Subscribe to comments
                    Subscribe to comments
                
                