1

Having a few issues getting things to work after changing wordpress from http to https on a windows sever. The web.config file is a bit of a mare to work with and the hosting company seems to think that changing http to https in wordpress settings is the only change necessary. currently I can only get the site to load css/js files on any pages other than the homepage by using default permalinks. and when I try adding http to https redirects in the web-config it causes even more problems. I've exhausted google so any advice appreciated.

  • define('FORCE_SSL_ADMIN', true); – Pranav Bhatt Jul 21 '16 at 9:30
  • hi, yes that's already in my wp-config file - the issue I think is having to use web.config rather than htaccess – steve555555555555 Jul 21 '16 at 9:57
0

for anyone interested the hosting company is going to convert wp install to linux so that should sort things.

found this plugin https://wordpress.org/plugins/really-simple-ssl/ which could be good for anyone having issues on linux.

0

Put this in your web.config:

<system.webServer>
    <rewrite>
      <rules>

<rule name="HTTP to HTTPS redirect" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}"
                        redirectType="Permanent" />
                </rule>
</rules>
<outboundRules>
                <rule name="Add Strict-Transport-Security when HTTPS" enabled="true">
                    <match serverVariable="RESPONSE_Strict_Transport_Security"
                        pattern=".*" />
                    <conditions>
                        <add input="{HTTPS}" pattern="on" ignoreCase="true" />
                    </conditions>
                    <action type="Rewrite" value="max-age=31536000" />
                </rule>
            </outboundRules>
    </rewrite>
  </system.webServer>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.