-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Feature request: Force SSL #889
Comments
Did it from htaccess but forcing ssl from within grav would be great. |
+1 |
In Grav 1.1 you can already force ssl on at the page level. Just by setting What is currently missing is a site-wide setting however. |
i just added redirect to https in htaccess, and |
Good idea to have a global one |
I was already aware of having secured pages with the The global setting further has the advantage, that it doesn't need |
PRs welcome :) I'm supposed to be on holiday! |
Started working on this PR: #899 Please test and report if you got any issue. Currently does not take into consideration custom ports, something it should most probably do. |
@flaviocopes It does work. However instead of checking |
Yes you can do that too, just another approach. If you want to improve it, feel free! 👍 Anyway this remains a rather slow way of redirecting users, since you first need to instantiate Grav. |
Ok, great. I'll think about it and provide a PR (most likely next week). I don't care if the first call is a slow process. It fortunately happens only once. Although |
Correct me if I'm wrong, but .htaccess will mainly redirect the page rather than enforce https on assets? And as Sommeregen says, a .htaccess rule will do this on every instantiation of Grav, whilst a mechanism internal to Grav will only run on every recache. |
The PR ensures that if you access a page via http, but you force https, it will issue a redirect to the https page. The browser is redirected, it's not an internal Grav thing. Same goes for assets if called through a page route, but not if accessed directly. |
So, .htaccess does the same, but at a lower level, and faster |
#899 has been merged so I'm going to close this issue and add my 2 cents on this matter. Even though the option is there, I would highly suggest to stick to the I actually don't quite like the implementation of this option with #899, With the So, I really hope this explanation really discourages each and everyone of you in using the |
Unless changing
.htaccess
currently there is no option in Grav to force redirecting the user to a secured site.The text was updated successfully, but these errors were encountered: