-
Notifications
You must be signed in to change notification settings - Fork 18
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
Static error-(404|500).html not honouring https protocol from .env SS_BASE_URL #20
Comments
Right, it should honour |
What if we used protocol-less absolute urls for base url? E.g. I would make |
That's an interesting idea actually. I'm not sure whether that is (or isn't) allowed as I couldn't find an example in the specs of |
Try it out in a project I think it works fine ;) You can just hard-code it into your template. |
I don't think that the fact it works it too relevant, there is a LOT of broken stuff that works in browsers ;-) It's more as to whether it is allowed/intended...
Then the definition of absolute URL states:
It's a rabbit hole and to be honest I cannot find any reference to, or example of a base url using the "protocol-less" variation. I suspect this may not only be bad practice, but also something that should be avoided for something like |
Sorry, I just found one of interest: https://stackoverflow.com/questions/21908318/can-i-use-a-protocol-relative-base-tag |
oh, I really wouldn't do protocol less for the base tag... |
Could we statically cache both versions, and serve them up conditionally? |
So it could be a relative url, just that google's crawler has a few issues with it. I might suggest something that we can allow web devs to configure, rather than fix them to one solution. |
No, I think that means that relative urls (eg I still don't understand however why the absolute URL cannot be taken directly from the defined |
I think it should take |
I guess subsites needs separate error files with different bases? |
they definitely aren't - I've tried that before, it's not compliant... works in some browsers but it's not meant to |
Hey guys, considering the |
I'd put this back on But: Can't you just work around the issue by not including the base tag in your template in the first place? As far as I understand, the only reason it's there is to allow serving SilverStripe from a subfolder (like |
That's a very valid point @chillu - and ironically it hadn't even crossed my mind (that I can recall) not to use the base tag, probably because it has always been a default is all templates including those still provided by SilverStripe. I actually still use the OK, point noted, I will start removing these unless absolutely necessary in the meantime. +1 for getting it resolved anyway, thank you! |
When static error pages are generated from the cli with
dev/build
theerror-404.html
anderror-500.html
files contain a<base>
url that appears hard-coded to usehttp
when theSS_BASE_URL
is specified withhttps
.EG:
SS_BASE_URL="https://www.site.com"
will produce<base href="http://www.site.com/"><!--[if lte IE 6]></base><![endif]-->
in the static files.This causes "breakage" on the front-end when css & JS is blocked due to a downgraded protocol.
The text was updated successfully, but these errors were encountered: