0

I have a weird problem that when I set the site address and wordpress address to https (within settings > General) I'm receiving a redirect loop when accessing the wp-admin and no css/js etc on the front end (with the error This request has been blocked; the content must be served over HTTPS.)

Is there something I'm doing wrong?

I've tried redirecting to https with htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R,L]
</IfModule>

as well as various plugins but keep getting the redirect loop issue!

Update

I've tried:

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

and still getting a redirect loop!

Cheers.

nvaughan84
  • 463
  • 6
  • 13
  • https://stackoverflow.com/questions/4083221/how-to-redirect-all-http-requests-to-https – ɹɐqʞɐ zoɹǝɟ Jul 15 '15 at 16:51
  • 1
    testing the port isn't 100% correct. it's possible to do SSL on ANY port, including 80, if the webmaster so chooses. you should be testing `%{HTTPS}`, which will tell you if https is in use, regardless of the actual port. – Marc B Jul 15 '15 at 16:57
  • Thanks Marc. I've updated my comment – nvaughan84 Jul 15 '15 at 17:01
  • did you set both the wordpress site url and wordpress location in the general section of wordpress to have https – ArtisticPhoenix Jul 15 '15 at 17:36
  • Hi ArtisticPhoenix. Yeah, I've set both Wordpress and Site Url to HTTPS. I've done this on other Wordpress sites and no problem. I've tried a fresh install of Wordpress and disabled all plugins but still the same problem – nvaughan84 Jul 16 '15 at 08:23

2 Answers2

0

If you have a plugin that has a setting that forces the site to use http that can be your problem. This happened to me once with WooCommerce. The checkout used https but the plugin forced the page into http which was then forced into https etc...

Jeff Mattson
  • 394
  • 3
  • 9
  • Hi Jeff, Thanks for your suggestion. I've tried a fresh install of Wordpress and disabled all plugins but I'm still getting the redirect loop problem :( – nvaughan84 Jul 16 '15 at 08:22
0

Found the answer to this here: Wordpress WP-ADMIN HTTPS Redirect Loop

Add the following to wp-config.php:

$_SERVER['HTTPS'] = 'on';
Community
  • 1
  • 1
atlas_scoffed
  • 3,542
  • 30
  • 46