WordPress.org

Ready to get started?Download WordPress

Forums

WordPress should automatically add http:// in the URL if the user misses it (10 posts)

  1. Gouri
    Member
    Posted 2 years ago #

    I will give a real life scenario I faced:

    In my website: http://www.bestwebhostingsites.org/

    I tried adding a hyperlink in one of my blog posts. So, I pasted this in the URL box of the visual editor: http://www.bestwebhostingsites.org/bluehost

    WordPress neither corrected this error nor prompted me to do so. But luckily enough, I happened to check the final (published) output which turned out to be like this: http://www.bestwebhostingsites.org/www.bestwebhostingsites.org/bluehost

    I tried finding the error but it was very difficult to find. It was only after spending 1 hour that I realized that http:// prefix was missing in my URL which was resulting in all this.

    Can't we have an arrangement through which the initial http:// is automatically added by wordpress whenever it is missing.

    I tried experimenting this in MS Word and found that it takes care of this problem so well. In fact, you can never have this error in MS Word.

    How nice it would be if we could have something similar in WordPress as well!

  2. kjodle
    Member
    Posted 2 years ago #

    Are you using the visual editor or the HTML editor?

    The http:// is automatically included when adding links in the visual editor. However, it is also selected, so that if you just paste a link without that, it will disappear. You have to deselect it first (hit the down arrow) to preserve it.

    On the other hand, if you are pasting a URL which includes that, you need to nothing. Just paste.

  3. How does WordPress know you didn't intend to put in a different URL?

    What if you want to put in mailto:foo@example.com or ftp://....

    There's more than just http :)

  4. Gouri
    Member
    Posted 2 years ago #

    @ kjodle: I am using Visual editor. Though http:// shows up by default in the box, it gets easily replaced when we copy paste something.

    Nothing goes wrong if we do everything correctly, but the problem occurs when we omit to do something.

    It's worth noticing how MS Word handles the URL text without http://

  5. Gouri
    Member
    Posted 2 years ago #

    @ Ipstenu: Maybe you're right. But even then, changing the final output as mentioned in the post above (prefixing the site's URL) is unwarranted.

    Also, It should not a problem sensing whether the user intends to use mailto: or ftp://. MS Word does that so beautifully. If your URL starts with mailto: or ftp://, it does not prefix http://

  6. esmi
    Forum Moderator
    Posted 2 years ago #

    But what if you simply want to refer to a site/company such as Yahoo.com but do not want to make a link? At least with the current system, you have a choice. With your approach, there would be no such choice.

  7. Gouri
    Member
    Posted 2 years ago #

    @ esmi: We are talking about the hyperlinking process that starts once you click on the hyperlink icon in the visual editor.

    If you do not want to hyperlink, don't insert the link (don't use the hyperlink icon in the visual editor).

  8. Gouri, since there's no one-right way to do it correctly for all situations, this setup provides the flexibility we need.

    If you force http:// in, then I can't use relative URLs (i.e. /foo/) which I shouldn't anyway, but some people wanna. We shouldn't nanny-gate them.

    Personally I'd like it so that when you click on add a link, http:// isn't already selected, but the cursor's at the end of the line :/

  9. Gouri
    Member
    Posted 2 years ago #

    Ya, looks like the relative URL thing comes in the way of implementing this suggestion.

    Keeping the http:// intact in the beginning would keep things simple, but as you said in your earlier post, it would again be a hurdle if somebody wanted to replace it with ftp:// or mailto: or something similar.

  10. kjodle
    Member
    Posted 2 years ago #

    It's worth noticing how MS Word handles the URL text without http://

    You're comparing WordPress to a MS product? Dude.....

    Nothing goes wrong if we do everything correctly

    Well, there's your solution. There's one way to do things correctly and an infinite number of ways to do it wrong. It's kind of hard to build a system which accounts for that.

    BTW, I so detest the way that MSO handles the whole link thing (and lots else, besides), that I switched to OpenOffice. All happy now.

Topic Closed

This topic has been closed to new replies.

About this Topic