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

SITEURL should be without protocol (no http://) #1532

Closed
22decembre opened this issue Nov 15, 2014 · 17 comments
Closed

SITEURL should be without protocol (no http://) #1532

22decembre opened this issue Nov 15, 2014 · 17 comments

Comments

@22decembre
Copy link

By using http:// in SITEURL, the page are generated with http hard-link, which does not let the user switch to https protocol (if wanted).

The page can be loaded in https, but all links, referals, pictures... are in http.

@justinmayer
Copy link
Member

The relevant line in my settings file is:

SITEURL = https://example.com

So I don't see the problem. Perhaps you can be more explicit?

@smartass101
Copy link
Contributor

I think what @22decembre means is that some people prefer to use HTTPS if available and by setting SITEURL we prevent them from freely choosing either HTTP or HTTPS, they will have to use the protocol in the links.

However, it can be worked around by having two pelicanconf.py files for both protocols and generate a site for each.

Another possible solution is to use RELATIVE_URLS.

So I don't think this is bug, but we could resolve this issue by adding a FAQ entry listing these two approaches to the problem.

@justinmayer
Copy link
Member

In no particular order:

  1. Perhaps I'm having an obtuse day, but I still don't understand the perceived issue and don't feel inclined to do much of anything until the OP adds sufficient detail.
  2. If a site is available over HTTPS, why would anyone willingly choose HTTP?
  3. FAQs are for frequently-asked questions. I'm not sure that this qualifies.

@smartass101
Copy link
Contributor

While your argument about no reason to prefer HTTP over HTTPS is a valid one, I've encountered situations where e.g. the server's certificate was expired or wrong and I had to switch to HTTP.

Switching between the protocols certainly are edge cases. The workarounds I describe above suffice IMHO, I don't really see how a static generator can create protocol agnostic absolute links anyways. Wouldn't you say @22decembre ?
As for th FAQ, I'm just wondering whether we should document it and where.

@22decembre
Copy link
Author

on my website, I have a cacert cert, thus I want to allow people to come and choose whether they use http or https. In that case, it makes sense : Cacert is not known everywhere (I don't know if my parents, who are common visitors of my blog, know Cacert or if they have it in their browser).

To address that particular problem, I customized my current template to show a logo saying «I use cacert, you can visit with https». This is available in the pelican-theme github now, and in use there :

www.22decembre.eu

On relative_links… I don't know. Maybe the solution indeed. In any matter this option should be better explained.

@22decembre
Copy link
Author

and relative_url is marked for dev' purpose. Right ? Will it work on a full website ?

@justinmayer
Copy link
Member

Do you utilize Atom/RSS feeds? If not, you can probably get away with not specifying SITEURL at all, which should essentially give you what you want.

@22decembre
Copy link
Author

I use rss yes. I believe it's not the solution.

Why not making everything available with just 'www.site.url' ?

@smartass101
Copy link
Contributor

Most standards (feeds do IIRC) require a fully qualified URL, including the the protocol.

@22decembre
Copy link
Author

ok, so indeed a bit hard to make it agnostic yes...

No idea or solution.

@justinmayer
Copy link
Member

What happens if you set SITEURL using a scheme-independent URL?

SITEURL = "//example.com"

In my testing, that behaves as expected.

@22decembre
Copy link
Author

@justinmayer : it seems to work ! Maybe it should be better explained in the doc and/or recommanded !

@justinmayer
Copy link
Member

For what it's worth, this is a well-established, universal convention.

For more information, refer to: http://www.paulirish.com/2010/the-protocol-relative-url/

@22decembre
Copy link
Author

yet, it's only the second time I hear about it ! (the first time being a buggy blog, hence aking it a bit less accurate ... :-s )

@22decembre
Copy link
Author

I just figure out that rss aggregators does not like the setup... :-S

@ingwinlu
Copy link
Contributor

can we close this?

@justinmayer
Copy link
Member

@ingwinlu: Yes. Thanks for the reminder.

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

No branches or pull requests

4 participants