http URLs changed to https

Created on 3 March 2015, over 9 years ago
Updated 8 January 2024, 9 months ago

I am having trouble ordering text format filters. If I put pathologic last, as recommended, then my email addresses are mangled messes of encoding and do not work (me@example.com becomes http://mysite.com/%26#109;ailto:me@example.com). If I put encode email addresses last, then some of my relative URLs are changed to the https protocol.

Link in source: /node/12345
Link in page: https://mysite.com/node/12345

Link in source: /sites/default/files/content/image1.jpg
Link in page: https://mysite.com/sites/default/files/content/image1.jpg

We do not use the https protocol at all on our site.

I have my processed URL formats set to full URL as follows:
http://prod.webhost.com
http://mysite.com
/

Should I set the filters to protocol relative URL?

If I remove the leading slash in front of node in my links it seems to work without adding the https. But I need the leading slash in front of file pointers to images and that path is also being changed to https.

πŸ› Bug report
Status

Active

Version

2.12

Component

Miscellaneous

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States ccarnnia

    Hi All,
    I off load https at the loadballancer and apche vhost is configured for port:80 only.
    By default I set /admin/config/content/pathologic to `protocol relative`.
    If I mistakenly choose the first option `FULL: URL` then the pages with embeded video or iframes with reative path get mixed mode error.
    Should `http` even be an option any more?

  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson

    Should `http` even be an option any more?

    While, as a web developer, I can't think of a reason in the real world why HTTP would be justified (non-real-world testing, where an SSL certificate is difficult, is an exception), I believe there's an important distinction here: http is not an option in Pathologic. The Full URL option renders URLs that match the base paths using whatever the site response base URL is. If the response is over http, the links will be rendered with http. If the response is https, all links will be rendered with https.

    So, while there may be no realistic scenario for http, I'm not sure that Pathologic should automatically convert the http protocol to https, regardless of what the site is using.

    As suggested in comments #7 & #8, an individual site could hook into Pathologic's filter and rewrite the protocol, if desired, using hook_pathologic_alter().

    If this were to be done in the module itself, maybe it should take the form of a new configuration option to "Convert HTTP to HTTPS"?

Production build 0.71.5 2024