-1

I want to redirect my subdomain to https. My .htaccess file contains the following:

RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https: //%{HTTP_HOST}%{REQUEST_URI}

It's redirecting to https but my chrome browser giving an error

This webpage has a redirect loop The webpage at https: //sub.domain.com/ has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer. Learn more about this problem. Error code: ERR_TOO_MANY_REDIRECTS

please help me

Jenny D
  • 28,400
  • 21
  • 80
  • 117

1 Answers1

0

I'm currently using following configuration for redirecting all requests for http://somedomain to https://somedomain:

RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [redirect=301]