/ Published in: Apache
1. Removes www using a mod rewrite condition. Put this in your .htaccess file or apache config.
2. Forces https on url.
2. Forces https on url.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# 1. force removal of www IN URL RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] RewriteRule ^(.*)$ http://example.com/$1 [R=301,L] # END force removal of www IN URL# force www IN URL # 2. start https check RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://example.com/$1 [R,L] # end https check