NixUser | Unix User | Linux User | NixUser


force https 301 redirect using htaccess

  To force your website with SSL using htaccess and mod_rewrite, use the following rule in the website’s .htaccess. RewriteEngine On RewriteCond %{HTTP_HOST} ^yourwebsite\.com [NC] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$$1 [R=301,L] If it’s a subdomain, use this. RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} sub RewriteRule ^(.*)$$1 [R=301,L] Note: Replace with the More