Posted By

jefferis on 01/09/16


php html htaccess rewrite https

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Force Rewrite for https and .html to .php in htaccess

 / 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.

  1. RewriteEngine On
  2. RewriteCond %{HTTPS} !=on
  3. RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L]
  5. RewriteRule ^(.*)\.htm /$1.php [R=301,L]
  6. RewriteRule ^(.*)\.html /$1.php [R=301,L]

Report this snippet  

You need to login to post a comment.