1

What is disallowed in the following URL?

http://myPortfolio/Showcase/Kimber+Tisdale+Photography

I am getting The URI you submitted has disallowed characters. error message. Where as as far as I understand + is allowed, isn't it?

Reference: Which characters make a URL invalid?

Community
  • 1
  • 1
StudentX
  • 2,243
  • 6
  • 35
  • 67

2 Answers2

1

It is an allowed character but not in the way you are using it. It is allowed in the query string part of a url, not in the url path names.

If you are just seperating words, it is more usual to use a hyphen or an underscore, or %20 for a space. You can use CI's url helper to encode strings for you:

$title = 'Kimber Tisdale Photography';
$url_title = url_title($title, '-');
// ouptut kimber-tisdale-photography

http://www.codeigniter.com/user_guide/helpers/url_helper.html#url_title

PaulD
  • 1,161
  • 1
  • 9
  • 14
0

The + is allowed in URI paths.

You can check it yourself:

  1. Visit the URI standard.
  2. Check which characters are allowed in the Path component.
  3. Note that every non-empty path may contain characters from the segment set.
  4. Note that the segment set consists of characters from the pchar set.
  5. Note that the pchar set contains characters from the sub-delims set.
  6. And sub-delims is defined to consist of:

"!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="

As you can see, the + is listed here.

(See my list of all allowed characters in URI paths.)

A prominent example of + in the path of HTTP(S) URIs are Google Plus profiles, e.g.:

https://plus.google.com/+MattCutts

Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360