On one Craft CMS site I have, all control panel URLs I call over HTTP are rewritten to HTTPS. E.g. the login page, as well as all its assets, are being served via https://www.mywebsite.com/admin/….

The rest of the site is available via https://www.mywebsite.com/

I've already tried to enforce HTTP via mod.rewrite in .htaccess, as well as explicitly setting baseCpUrl and an new cpTrigger in config/general – with no success at all.

Is this a feature that I can deactivate? A bug in Craft CMS 2.4.2670?
Or is this a server-side issue?

  • 1
    This is going to be something on the server side. Maybe share your .htaccess file as well as what's in your craft/config/general.php file?
    – Brad Bell
    Commented Sep 11, 2015 at 15:57
  • At first, I blamed the server, too, since my other Craft instances on other servers work flawlessly. But: why only the control panel, not the main site? How can one trigger a different protocol than the other? Anyway, here are my current .htaccess and config/general.php files: avantlalettre.ch/files/htaccess.txt ; avantlalettre.ch/files/config-general.txt — Thanks for checking it out! Commented Sep 12, 2015 at 0:13
  • Try removing everything after RewriteRule (.+) index.php?p=$1 [QSA,L] in your .htaccess file and see if that helps.
    – Brad Bell
    Commented Sep 12, 2015 at 4:51
  • 1
    So the server is switching to https and you want http instead? That won't happen automatically since you'd need a certificate, server config, etc. Sounds like there's more directives in apache's config/virtual host config.. Who runs your server? That's where I'd start... Commented Sep 14, 2015 at 4:55

1 Answer 1


It turned out not to be Craft's fault, indeed:

On the server, the HTTP_X_FORWARDED_PROTO environment variable was erroneously set to https in the reverse proxy – an issue that my hosting provider had to resolve.

(As a quick fix, the following line in index.php did the trick, too:)

 apache_setenv('HTTP_X_FORWARDED_PROTO', 'http');

Thanks to @brad-bell and @ritterknight for pointing in the right direction!

  • 1
    Glad to hear you got it sorted. Those sorts of problems can be maddening... Commented Sep 15, 2015 at 16:33

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.