• Resolved nick_names

    (@nick_names)


    This has happenend to me more then once: I add a link in a blogpost not noticing that it doesn’t start with https:// but with www. only, e.g. www.link.com

    When I publish the article WordPress changes the link from www.link.com to https://myblogurl.com/www.link.com resulting in a 404.

    Live example here (link on the pic/gif): https://www.web-crap.com/wann-kommt-der-westwind/

    Is there any way to prevent this?

    Wait and if I put https:// in front of the url WP changes it to www.? (link on first word ?Link.“ in text).

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator James Huff

    (@macmanx)

    Not really, that’s how URLs are supposed to work. https:// is what establishes it as an absolute URL.

    If you leave out https:// it’s a relative URL, meaning relative to where it is.

    As you’ve seen, if you put in https://example.com was an URL, it will be a link to https://example.com

    If you put it in as just example.com every browser will assume it’s yoursite.com/example.com

    As relative URLs are a valid thing, you include a URL as /images/funnyimage.jpg because it’s actually at yoursite.com/images/funnyimage.jpg, there’s no way to override the behavior.

    Thread Starter nick_names

    (@nick_names)

    Thanks for the answer!

    I undertand that /images/funnyimage.jpg changes into https://www.yoursite.com/images/funnyimage.jpg that’s how it always works, I think.

    But the problem is not with URLs like example.com but with WWW.example.com. I think in a normal HTML file a href="www.example.com" would just link to https://www.example.com and not https://www.yoursite.com/example.com (why would I want that?)

    Shouldn’t WP treat www. just like https:// and see that it is an external domain and not put yoursite.com/ in front of it?

    Moderator James Huff

    (@macmanx)

    Right, it’s still a relative URL without https:// or https:// that’s just how browsers work in general, and I don’t think there’s any plans to make WordPress the exception to that rule.

    I agree it would be nice, and maybe someone should make a plugin for it, I just don’t see WordPress itself adopting its own protocol in this regard.

    Thread Starter nick_names

    (@nick_names)

    Wow, you’re right, I’m so sorry. HTML-only is the exact same thing.

    Well, consider this issue closed, I guess : (

    Moderator James Huff

    (@macmanx)

    You’re welcome!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Don't put blog-URL in front of www-links.’ is closed to new replies.