2

Well i know this looks pretty easy , but i have been working on it from a couple of hours now . but looks bit strange , there are quite a few solutions on having http to https permanent redirect , but are not working .

I have a Yii application , version 1.1 which is quite old now , but it is built on it and want application to be on permanent https .

and for that .htaccess i am using is :

RewriteEngine on

# manual change the url base
RewriteBase /

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php

this is what is recommended on quite a few SO answers ,

But for me they are giving net::ERR_TOO_MANY_REDIRECTS

and then followed by 503 (Service Unavailable: Back-end server is at capacity) as application is on aws .

I am not much into regex thing , so can anyone help me with it or put me in right direction .

cheers .

Anil Sharma
  • 2,952
  • 5
  • 29
  • 45
  • I would suggest looking at the access log to see what is doing the redirect. It makes me wonder if you are getting ping-pong'd between `http -> https -> http -> https` over and over. As in htaccess is redirecting to https, then php/yii is redirecting to http in a loop. I assume you could also look at the network tab in the developer tools if you turned on preserve navigation – Jonathan Kuhn May 03 '17 at 21:58
  • How is your SSL managed? Can you access the HTTPS version of your site? See also this (recent) question: http://stackoverflow.com/questions/43743283/htaccess-rewrite-too-many-redirects – MrWhite May 03 '17 at 22:36
  • Check this ... http://www.yiiframework.com/wiki/407/url-management-for-websites-with-secure-and-nonsecure-pages – Hmmm May 16 '17 at 08:17

1 Answers1

0

Try add command to your apache configuration file

LogLevel warn rewrite:trace5

to see, what is going on.

venoel
  • 463
  • 3
  • 13