WordPress.org

Ready to get started?Download WordPress

Forums

WP-HTML-Compression
[resolved] Stripping https from links (16 posts)

  1. Ed
    Member
    Posted 1 year ago #

    Hi,

    Not sure how long this has been happening as we've only just noticed it, but everytime you include a https link on a page HTML Compression strips it, leaving only the //. This has broken a few links, disabling the plugin fixes it.

    Cheers,
    Ed

    http://wordpress.org/extend/plugins/wp-html-compression/

  2. Steven Vachon
    Member
    Plugin Author

    Posted 1 year ago #

    If your site is running in https and your links have https in them, such will be stripped. This is fully-working, standard code and is fine for SEO.

  3. Ed
    Member
    Posted 1 year ago #

    It's a http site with https anchor links to other places. It breaks links.

  4. Steven Vachon
    Member
    Plugin Author

    Posted 1 year ago #

    I'll have to look into that, then. It's possible that it's a bug.

    Could you provide me with some before and after URLs? Not example ones, but [https] ones that are actually causing an issue. Also include the URL of the active [http] page generating the errors.

  5. Ed
    Member
    Posted 1 year ago #

    Old: <a href="https://primaryessence.co.uk/">Primary Essence</a>
    New: <a href="//primaryessence.co.uk/">Primary Essence</a>

    Cheers,
    Ed

  6. Steven Vachon
    Member
    Plugin Author

    Posted 1 year ago #

    and the URL of the page with that HTML?

  7. Ed
    Member
    Posted 1 year ago #

    Sorry I've had to remove it as it was hindering a paid service. I'll try create another one for you today to show you.

  8. Ed
    Member
    Posted 1 year ago #

    Sorry for the delay, link: http://admindemo.academyblogger.co.uk/

    They're in a text widget, first one is http:// second one is https://.

    Thanks,
    Ed

  9. Steven Vachon
    Member
    Plugin Author

    Posted 1 year ago #

    Your other links are not shortened. You must not have WP-HTML-Compression enabled...

  10. Ed
    Member
    Posted 1 year ago #

    It's definitely enabled, otherwise the source wouldn't be compressed. It leaves http links alone, only changing https links. There are no other plugins enabled that would cause it to strip the prefix, if I disable the plugin then they return.

  11. Steven Vachon
    Member
    Plugin Author

    Posted 1 year ago #

    Please provide before and after HTML. I'll run the whole thing through some tests.

  12. Ed
    Member
    Posted 1 year ago #

    Before:

    <a href="https://google.com/" target="_blank">Google HTTPS</a>

    After:

    <a href="//google.com/" target="_blank">Google HTTPS</a>

    Or are you wanting the entire source?

    Thanks mate,
    Ed

  13. Steven Vachon
    Member
    Plugin Author

    Posted 1 year ago #

    The entire "before" source, yes. The reason being that your "after" source is very much not as it should be

  14. Ed
    Member
    Posted 1 year ago #

    If so...

    Before: http://c.ed.gs/KEiW
    After: http://c.ed.gs/KEC0

    Ed

  15. Steven Vachon
    Member
    Plugin Author

    Posted 1 year ago #

    Works perfectly fine here. Thoroughly tested it and could not reproduce your issue.

    The only issue I ran into was with http images/stylesheets/scripts on an https site where WebKit would do a secure semi-redirect to http to allow those items to load. This, however, did not affect the the shortened links at all.

  16. Steven Vachon
    Member
    Plugin Author

    Posted 1 year ago #

    The only way I can reproduce this issue is by manually setting a custom site URL in the class constructor to https when the site is running in http.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.