0

I need to implement SSL redirection. The HTTP/https and non-www URLs should forcefully redirect to https://www URLs.

There exists browser authentication code in htaccess file and this is the reason behind which redirecting to https://exmpledomain/.shtml

Akhil
  • 1
  • 2
  • 1
    Possible duplicate of [Redirect to https using .htaccess](https://stackoverflow.com/questions/25191762/redirect-to-https-using-htaccess) - or https://stackoverflow.com/questions/13977851/htaccess-redirect-to-https-www – maio290 May 28 '19 at 12:08
  • If I remove browser authentication my redirection code is working properly – Akhil May 28 '19 at 12:17

1 Answers1

0
After the Authentication code please write this

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{THE_REQUEST} ^(GET|HEAD)\ ([^\ ]+)
RewriteRule ^ https://www.%{HTTP_HOST}%2 [L,R=301]

RewriteCond %{HTTPS} off
RewriteCond %{THE_REQUEST} ^(GET|HEAD)\ ([^\ ]+)
RewriteRule ^ https://%{HTTP_HOST}%2 [L,R=301]
Akhil
  • 1
  • 2