1

WordPress is changing all my URLs from:

https://www.example.com/...

to:

//www.example.com/...

For example:

<link rel="canonical" href="//www.example.com/"/>

I don't want this to happen, because it has some side effects with CDN rewriting, and my site is https only.

What is the best way to disable this "feature"?

1
  • To me this sounds like a bug in some plugin. Try to disable all plugins and/or change the theme and see if that behavior is gone. Then re-activate plugin after plugin and check when the behavior is back… Feb 28, 2016 at 13:05

1 Answer 1

0

It was caused by CloudFlare https (which doesn't set the $_SERVER['HTTPS'] variable), I solved it by forcing:

$_SERVER['HTTPS'] = 'on';

in the webserver configuration. After doing so I could also disable the CloudFlare Flexible SSL plugin, and get a little performance gain.

1
  • 2
    Since you were able to answer your own question, please click the green checkmark to indicate that this is resolved for record's sake. Thanks Aug 23, 2016 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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