ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Spaces in URLs

July 08, 2009 2:44pm

Subscribe [2]
  • #1 / Jul 08, 2009 2:44pm

    Perak

    45 posts

    One of my forum users has brought up an interesting point. He’s trying to post a URL/link to some photos he took, but the URL has a space in it. The forum system breaks the URL at the space, whether the space is left in or replaced with the old “percent 20” deal.

    What’s the secret to posting a clickable URL that contains a space in the forums?

  • #2 / Jul 08, 2009 3:12pm

    Ingmar

    29245 posts

    This seems to work:
    http://example.com/foo bar.jpg

    Basically, ]url[ ... ]/url[ around the link. That said, spaces are technically illegal in URL and should be avoided at all reasonable cost.

  • #3 / Jul 08, 2009 3:19pm

    Perak

    45 posts

    Hi, Ingmar.

    I just tested it again. A URL with a “percent 20” or with a space worked OK if enclosed in URL brackets.

    [url]http://example.com/foo bar.jpg[/url]

    However, just pasting in a URL with a space or a “percent 20” resulted in a broken link the forum created the link automatically.

    Is the secret to simply enclose it in the URL brackets?

  • #4 / Jul 08, 2009 3:24pm

    Ingmar

    29245 posts

    I’d say so. The issue is this: if you are relying on the autoconvert feature, how is EE determining where the URL ends?

    Consider these examples:

    http://example.com/ is a cool site.
    http://example.com/test/ is a sub directory there.
    http://example.com/foo bar.jpg is the image I wanted to share with you.

  • #5 / Jul 08, 2009 3:34pm

    Perak

    45 posts

    Thanks, Ingmar!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases