-1

Please let me know how I can redirect http domain to https domain hassle free via htaccess file. I want to redirect this domain

http://example.in to https://example.com

domain.

Please help me out.

Thanks in advance!!!

magento2
  • 47
  • 2
  • 9

1 Answers1

0

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}
Josep Bové
  • 626
  • 1
  • 8
  • 22