Tutorial :Can we use & in url?


Can we use "&" in a url ? or should "and" be used?


Yes, you can use it plain in your URL path like this:


Only if you want to use it in the query you need to encode it with %26:


Otherwise it would be interpreted as argument separator when interpreted as application/x-www-form-urlencoded.

See RFC 3986 for more details.


An URL is generally in the form


So it is not advisable to use it in an URL unless you want to use it for parameters. Otherwise you should percent escape it using %26, e.g.


This results in the path being submitted as hello&world. There are other characters which must be escaped when used out of context in an URL. See here for a list.


Unless you're appending variables to the query string, encode it.


encode '&' with & (this answer is based on your use of tags)

If you are asking what to use "&" or "and" when registering the name of your URL, I would use "and".

EDIT: As mentioned in comments "& is an HTML character entity and not a URI character entity. By putting that into a URI you still have the ampersand character and additional extraneous characters." I started answering before fully understanding your question.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »