How to use PHP htaccess file

Just create a file with .htaccess file in your website folder. For Redirect website http://example.com to http://www.example.com RewriteEngine OnRewriteCond %{HTTP_HOST} !^www. [NC]RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] For Redirect website http://example.com to https://www.example.com RewriteEngine OnRewriteCond %{HTTP_HOST} !^www.RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L] When you… Read More