Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 doesn't automatically get HTTPS #21

Open
sam327 opened this issue Jan 8, 2020 · 1 comment
Open

404 doesn't automatically get HTTPS #21

sam327 opened this issue Jan 8, 2020 · 1 comment

Comments

@sam327
Copy link

sam327 commented Jan 8, 2020

I've got a site set up with Patrol, and it forces the HTTPS and www on most pages fine. I've got the sslRoutingBaseUrl, sslRoutingEnabled, and sslRoutingRestrictedUrls set in my general.php config file (just like in the example). It works 99% of the time.

But it doesn't work right for 404s.

Normally, when I go to a page, it automatically changes from http://mysite.com/mypage to https://www.mysite.com/mypage

But when I got to a broken page, http://mysite.com/brokenpageurl, it doesn't redirect.

My 404.twig template lives in the root of the templates directory. So if I go to mysite.com/404, it automatically redirects to https://www.mysite.com/404 - because it's a real page.

But when another page exits to a 404, it doesn't redirect.

I haven't tested 403 or other error pages.

I can reproduce this on a couple unrelated sites. So I'm wondering if the 'exit to 404' bit happens before patrol gets a chance to do its redirect.

@selvinortiz
Copy link
Contributor

@sam327 Your assumption is correct. Patrol is no longer able to initialize in the same way it did in Craft 2 because some of the mechanics for doing that are gone in Craft 3.

I'll have to do some more testing and figure out a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants