Issue
so I have installed ssl certificate on my server, so if search using https://www.domain.info its secure connection. but if i search using www.domain.info or http://www.domain.info it doesnt redirect to https for a secure connection.
this is my current htaccess content
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
Solution
Looks like your htaccess file is not enabled mod rewrite rule at present, try un-commenting line LoadModule rewrite_module modules/mod_rewrite.so
once. Plus go through article https://phoenixnap.com/kb/how-to-set-up-enable-htaccess-apache for understanding on how to enable htaccess file.
Also change your rules to following.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
Answered By - RavinderSingh13
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.