Please let me know how I can redirect http domain to https domain hassle free via htaccess file. I want to redirect this domain
domain.
Please help me out.
Thanks in advance!!!
Please let me know how I can redirect http domain to https domain hassle free via htaccess file. I want to redirect this domain
domain.
Please help me out.
Thanks in advance!!!
Apache doesn’t recommend to use this in the .htaccess, you can read about it here.
You should use this instead:
<VirtualHost *:80>
ServerName www.example.com
Redirect / https://www.example.com/
</VirtualHost>
<VirtualHost *:443>
ServerName www.example.com
# ... SSL configuration goes here
</VirtualHost>
In case that you want to use .htaccess anyway you need to use the next rewrite:
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}