0

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 Sep 11 '15 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! – Avant la lettre Sep 12 '15 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 Sep 12 '15 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... – RitterKnight Sep 14 '15 at 4:55
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!

| improve this answer | |
  • 1
    Glad to hear you got it sorted. Those sorts of problems can be maddening... – RitterKnight Sep 15 '15 at 16:33

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.