1

I'm deploying my cakephp 2.6 website on AWS Beanstalk with this .htaccess file

<IfModule mod_rewrite.c>

  RewriteEngine on

  RewriteRule ^$ app/webroot/
  RewriteRule (.*) app/webroot/$1

  # Redirect força HTTPS
  RewriteCond %{HTTPS} !=on
  RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NC,L,R=307]

</IfModule>

I need to force httpS and use app/webroot as default folder.

Without https rules, it was working fine, but now I'm getting too many redirects error.

any idea?

anderlaini
  • 1,593
  • 2
  • 24
  • 39
  • I would guess, even with just the second rule, you would have a rewrite loop and get a 500 error. – Olaf Dietsche Jun 24 '16 at 15:47
  • See http://stackoverflow.com/questions/18647302/htaccess-redirect-loop-when-trying-to-add-forced-https-rule-amazon-elastic-bea#answer-18665928. The answer there worked for me when trying to force https with Elastic Beanstalk via .htaccess – user1791914 Nov 02 '16 at 17:11

0 Answers0