• Resolved alphapixa

    (@alphapixa)


    Hi there,

    I have a couple of links to external URLs on this page of my site: https://www.alphapixa.com/project/website-kevin-lieber/ (on the right hand side under project details).

    The first link has been entered as a http, but is translated as https and since the https does no exist, the link is broken.
    The second link does not translate as a https and works.

    I can’t see the difference between the way the two have been entered, so am a bit stumped. Any ideas?
    Regards,
    Victoria

Viewing 6 replies - 16 through 21 (of 21 total)
  • Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    I have made a note of this. I can’t say at this moment why this is happening, this will have to be investigated. For now, you could disable one of these options to make it work.

    As soon as the cause of the conflict is known, we can probably create a fix for this. I’ll let you know.

    very puzzled is what I am .. 😉

    @rogierlankhorst: AO uses the output buffer as well, so certainly possible there’s some kind of problem there, but in that case I would assume the final HTML to be wrong (i.e. with the first URL in HTTPS), which is not the case?

    Thread Starter alphapixa

    (@alphapixa)

    @rogierlankhorst – thanks very much. I will disable for now.

    @futtta – I reckon I might have confused you there. The html I pasted is as I see it in the page builder in the wordpress backend. If I “inspect”, then I do see the https rather than http in the code.

    Confusing, but at least I have a workaround for now 🙂

    Plugin Contributor Rogier Lankhorst

    (@rogierlankhorst)

    @futtta, @alphapixa, I think I have found the cause. The problem starts with this regex:

    ‘/<link .*?href=[\'”]\K(http:\/\/)(?=[^\'”]+)/i’

    This matches stylesheets that have a http url. This regex, in combination with the optimization, continues to match across html elements, ending up with the href=http url. It looks like the removing of the linebreaks causes the regex to match.

    Extending it so it excludes matches where the closing tag is found between, seems to fix the issue.

    ‘/<link[^<>]*?href=[\'”]\K(http:\/\/)(?=[^\'”]+)/i’

    it is committed to github:
    https://github.com/rlankhorst/really-simple-ssl

    I’ll run some tests, and if all goes well, the update will be published in a week or so.

    Thank you for your input.

    great job, bedankt voor de bevestiging @rogierlankhorst!

    Thread Starter alphapixa

    (@alphapixa)

    super! thanks @rogierlankhorst!

Viewing 6 replies - 16 through 21 (of 21 total)

The topic ‘External Links forced to Https://’ is closed to new replies.