Is it bad to use parentheses in a URL

10,363

Parenthesis are "reserved sub-delims" as defined by the RFC 3986. That means that the character may have special meaning in certain parts of the URL. Here is what the RFC says about how they should be treated:

URI producing applications should percent-encode data octets that correspond to characters in the reserved set unless these characters are specifically allowed by the URI scheme to represent data in that component. If a reserved character is found in a URI component and no delimiting role is known for that character, then it must be interpreted as representing the data octet corresponding to that character's encoding in US-ASCII.

You are using the parenthesis in the path section of the URL. Parenthesis do not have special meaning in that section of the URL. The only restrictions on the path appear to be:

The path is terminated by the first question mark ("?") or number sign ("#") character, or by the end of the URI.

Therefore you may use parenthesis in the path of the URL, but you could encode them with %28 and %29. As w3d says in the comments, software that uses heuristics to pick URLs out of text may not recognize the full URL when it contains unescaped parenthesis.

Share:
10,363

Related videos on Youtube

Matthew Dresser
Author by

Matthew Dresser

Updated on September 18, 2022

Comments

  • Matthew Dresser
    Matthew Dresser over 1 year

    Is it bad to use parentheses within a site's URLs? For example in my site, I have broken a three part article as such:

    www.example.com/article-on-some-subject-(part-1-abc)
    www.example.com/article-on-some-subject-(part-2-def)
    www.example.com/article-on-some-subject-(part-3-hij)
    

    Is there any SEO penalty or potential browser incompatibility issue with using the parentheses ( and ) within the URLs.

    • MrWhite
      MrWhite about 9 years
      You could find that some (forum) software / email clients might not correctly recognise it as being part of the URL when parsing plain text?
  • DisgruntledGoat
    DisgruntledGoat about 9 years
    Wikipedia gets along just fine using parentheses in URLs. Though personally I'd avoid using them, for simplicity.