• Resolved light1364

    (@light1364)


    Hi,

    I installed WordPress in a subfolder and have 301 redirect loops when loading my WordPress website over https.

    My domain runs on IIS and has an SSL certificate. The IIS settings (set up by my web host) force everything on the domain to go over https, every http link typed in the web browser is redirected to https. Besides HTTP being redirected to HTTPS, I wrote an URL rewrite rule in web.config that redirects www to non-www. This all works fine on my main website and other websites in subfolders (normal websites, non-WordPress or alike).

    However, this doesn’t work with the WordPress website, installed in a subfolder. The WordPress websites keeps redirecting, sending back 301’s, and in the end Firefox ends up with “Too many redirects”. Now comes the strange part, this works 100% in the login and admin panel, the wp-admin loads over HTTPS without any issues or mixed content and the admin panel itself works 100% over HTTPS, even the site preview works. The WordPress website itself does not and produces this infinite 301 redirect loop.

    Initially, the same thing happened to the admin panel and login as well, but adding $_SERVER[‘HTTPS’]=’on’ to wp-config.php fixed this. However, for the WordPress website itself this doesn’t fix the problem. Another strange issue that occurred after install is that the address link was originally https://mydomain.com:443/wordpress, instead of simply https.

    This is what I have done so far:
    – Added define(‘FORCE_SSL_LOGIN’,true) in wp-config.php
    – Added define(‘FORCE_SSL_ADMIN’,true) in wp-config.php
    – Added $_SERVER[‘HTTPS’]=’on’ in wp-config.php
    – Set the WordPress Address url to https://mydomain.com/wordpress
    – Set the Site Address url to https://mydomain.com/wordpress
    – Changed permalinks to post names
    – After changing the permalinks option, added a rewrite rule in web.config to make the permalinks work, a separate web.config in the folder of the WordPress website, which complements my root web.config
    – Installed the iThemes Security plugin and set this up. The SSL option area states the following: “WARNING: Your server does appear to support SSL. Using these features without SSL support on your server or host will cause some or all of your site to become unavailable.” “Front End SSL Mode” is set to “Whole site” and “Force SSL for Dashboard” is checked.

    So in short, HTTPS works fully (no mixed content) when using the login and admin panel (even website preview), but does not work (301 redirect loop) when using the WordPress website itself.

    Can someone please help me with this issue. Please note I cannot make use of .htaccess since I’m using IIS and cannot find anything related to this issue using web.config.

    Thanks

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Redirect loop (301) using SSL on IIS’ is closed to new replies.