Help talk:URL

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Wikipedia Help Project (Rated NA-class, Mid-importance)
WikiProject icon This page is within the scope of the Wikipedia Help Project, a collaborative effort to improve Wikipedia's help documentation for readers and contributors. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks. To browse help related resources see the Help Menu or Help Directory. Or ask for help on your talk page and a volunteer will visit you there.
 NA  This page does not require a rating on the project's quality scale.
 Mid  This page has been rated as Mid-importance on the project's importance scale.


As best I can see, only these characters require encoding:

sp ! " , '  ; < >  ? [ ]
 %20  %21  %22  %2c  %3a  %3b  %3c  %3e  %3f  %5b  %5d

For example, contrary to documentation, the caret does not need encoding:^

The apostrophe really applies to sequential use, as it gets parsed as wikimarkup:

The pipe automatically gets encoded:

---— Gadget850 (Ed) talk 21:57, 7 April 2011 (UTC)


At the Buddha-nature page, there appears a problem with the = sing: The following url appears as a full url in the reflist, beside the assigned title/name, due to the = sign: [1]

  1. ^ [ The Doctrine of Attaining Buddhahood in One’s Present Form]

I've tried to fix it, by using %3D, but it doesn't work: [1]

  1. ^ [ The Doctrine of Attaining Buddhahood in One’s Present Form]

Using {{=}} doesn't work either: [1]

  1. ^ [ The Doctrine of Attaining Buddhahood in One’s Present Form]

Friendly regards, Joshua Jonathan (talk) 08:05, 7 March 2012 (UTC)

The problem with these examples isn't caused by the equals sign; it's because the title is split over two lines. If you replace that with a space, all is well:


-- John of Reading (talk) 08:15, 7 March 2012 (UTC)

That's it?!? What a joke to miss that one. Thanks!!! Joshua Jonathan (talk) 08:39, 7 March 2012 (UTC)

I think [1] is misleading. Below the table with = and %3d it says "Equals signs only need to be encoded when the url is used as an unnamed template parameter". But most url's are broken if = is replaced by %3d. For example, works but doesn't. In an unnamed parameter neither of them work: (the source has a template here) and both fail. A reliable fix is to replace = by {{=}} as explained at unnamed template parameter. This is an issue with Wikipedia template syntax and not with unsupportred url characters so if we mention it here then I think it should be outside the conversion table. PrimeHunter (talk) 12:50, 7 March 2012 (UTC)
Fair enough. I've reverted to Gadget850's version of this table. -- John of Reading (talk) 12:59, 7 March 2012 (UTC)
Three years on: Note that PrimeHunter's comment in the above thread has been broken by the deletion of Template:Identity. -- John of Reading (talk) 07:07, 8 September 2015 (UTC)
Oh, I have often used Template:Identity to test something, mostly in previews. My use here was removed in [2]. A new version of the broken part of the comment: {{{2}}}(the source has a template here) and both fail. PrimeHunter (talk) 11:58, 8 September 2015 (UTC)

HTTPS changes[edit]

I think that this page and WP:EL need to be updated now that "http" etc. are no longer necessary, and the links' destination (if it is within Wikimedia) will change automatically depending on whether you are viewing the HTTP or the HTTPS version of a Wikimedia site. It Is Me Here t / c 20:54, 18 December 2011 (UTC)

[ test] — Seems like you still need http:// (or https://) in the link code for it to work for me?
I would totally agree if not because Firefox and other browsers are starting to phase out showing HTTP to people as it's as no longer necessary for most people and just useless spam, in fact the only reason most people ever need to see a HTTP:// is because of sites like Wikipedia not parsing links that don't have it! --Mistress Selina Kyle (Α⇔Ω ¦ ⇒✉) 14:22, 11 February 2012 (UTC)
The MediaWiki software uses CSS to detect the URI scheme and render it as a linked URL; see Help:External link icons for details. ---— Gadget850 (Ed) talk 15:25, 11 February 2012 (UTC)
Yeah, but why not have the default be HTTP:// since 99% of links use that, it would add up to a lot of space saved overall when you consider the scale of Wikipedia and make things more pleasant for users to type Face-smile.svg If you look at most browsers they don't require people to type HTTP:// anymore and in Firefox they actively hide HTTP:// these days because most people just don't need to see it Face-smile.svg It shouldn't be there at all for common usage really, the only time people need it is when sites like Wikipedia fail to recognise .com/.net links as links! Face-smile.svg Most forums these days and social networks catch any mention of .whatever and parse it as a link Face-smile.svg Better for everyone --Mistress Selina Kyle (Α⇔Ω ¦ ⇒✉) 02:17, 12 February 2012 (UTC)
If you want to change the current scheme, then file a bug. I don't see how your link to is related to this. ---— Gadget850 (Ed) talk 12:09, 12 February 2012 (UTC)
Oh, as I said while each one is small, when you consider the scale of Wikipedia all the "http://"s added up, well, I haven't done the maths but I think be a lot of space overall saved? Face-smile.svg Definitely a lot more convenient for people when browsers are starting to phase out http:// Face-smile.svg --Mistress Selina Kyle (Α⇔Ω ¦ ⇒✉) 12:22, 12 February 2012 (UTC)
Don't worry about performance. Browsers are simply hiding the URI scheme— it is still a vital part of the naming structure. ---— Gadget850 (Ed) talk 12:34, 12 February 2012 (UTC)
Still it'd be nice for the size (not performance) to get rid of those gazillion http://
But most importantly make it more convenient writing references for editors, because when browsers are starting to delete http:// this is going to be more and more important as people are going to start growing up never seeing an http:// Face-smile.svg and for good reason, really, we know something .TLD is always going to be http unless otherwise specified, and computers should understand that too - most social network sites do, Wikipedia is still in the 2000s! Face-smile.svg --Mistress Selina Kyle (Α⇔Ω ¦ ⇒✉) 12:07, 15 February 2012 (UTC)
http:// is a URI scheme, not a TLD (which would be .com or the like). Again: browsers don't delete the URI scheme, they just hide them. If you have better way to do this, then ask for a feature enhancement. ---— Gadget850 (Ed) talk 12:14, 15 February 2012 (UTC)
I know, that's why I said "something .TLD is always going to be http" — there is no . in http:// Face-smile.svg
Well, we don't see DNS being converted into IP addresses either, hiding stuff is good for humans *shrug* --Mistress Selina Kyle (Α⇔Ω ¦ ⇒✉) 12:26, 15 February 2012 (UTC)

Can someone clarify link behavior with parenthesis?[edit]

Wiki-text markup treats a final right parenthesis in special ways. Consider:

I think the rule is that wikipedia drops the closing parenthesis unless the URL contains a left parenthesis. Can anyone confirm this, or give a pointer to the appropriate documentation? Blevintron (talk) 13:35, 23 April 2012 (UTC)

MediaWiki detects a URL by the URI scheme as noted, so no character before the URI will be included in the link.
No character that requires encoding will be included in the link:
And some characters are included in the link, and otheres are not. I am not sure why.
---— Gadget850 (Ed) talk 13:49, 23 April 2012 (UTC)
Definitive answer: According to includes/parser/Parser.php, function makeFreeExternalLink() (lines 1238--1243),
The following characters are stripped from the end of a free external link: comma ',', semicolon ';', backslash '\', period '.', colon ':', bang '!', question mark '?'.
A right parenthesis ')' is only stripped if the link does not contain a left parenthesis '('
Blevintron (talk) 16:06, 23 April 2012 (UTC)
Thanks. Looks like the encoding chart needs some updates. ---— Gadget850 (Ed) talk 19:28, 23 April 2012 (UTC)
No, this is a different concern than encoding. These characters are allowed within URLs unescaped unencoded. My comment relates to how wikipedia chooses to highlight links, not about what characters are allowed in a URL. I think it's incorrect to update the encoding charts.
For Example: is a valid link, and the parentheses do NOT need to be escaped. Blevintron (talk) 21:57, 23 April 2012 (UTC)


According to the table at Fixing links with unsupported characters, the characters "," (comma), ";" (semicolon) and "?" (question mark) are unsupported and need to be encoded. But as far as I can see these three work just fine in their original forms. Did something change or is the text just overly cautious?  --Lambiam 19:40, 6 June 2012 (UTC)

Ah, I see what the issue is. They are problematic at the end of a bare url (one not enclosed in square brackets): the parser does not parse them as part of the url. But the same problem also arises with these unlisted characters:

"!", ")", ".", ":" and "\".

 --Lambiam 20:09, 6 June 2012 (UTC)

space not encoded per this help page[edit]

For some reason {{urlencode:test test}} (now) gives test+test not test%20test as advertised on this help page. / (talk) 14:10, 31 July 2013 (UTC)

The encodings at Help:URL#Fixing links with unsupported characters are needed to get an external URL working properly inside Wikipedia markup. The urlencode parser function has a different purpose, to encode arbitrary text so that it can be part of a URL. -- John of Reading (talk) 14:31, 31 July 2013 (UTC)
I did mean in the context of encoding urls inside Wikipedia markup. That section specifically says "For example, a space must be replaced by %20 (this can be done using the parser function)." So if I want to link to test then the required url is [3] but using urlencode as suggested we get [4]. So the properties of urlencode have changed and either the help page should be updated or a bug has sneaked in and should be reported. / (talk) 15:09, 31 July 2013 (UTC)
Now I see what you are getting at. The job can be done with the urlencode function, but only by using one of its optional keywords: {{urlencode:test test|PATH}} is test%20test. I've added a few words to the help page to make this clearer. -- John of Reading (talk) 15:23, 31 July 2013 (UTC)
Ah. That explains it. Many thanks. / (talk) 16:11, 31 July 2013 (UTC)

Open a new page with a hyperlink[edit]

It appears that hyperlinks from Wiki replace the page that you are on and the back and forward arrows are used to navigate between hyperlinked locations once they are visited.

Is there a way to specify a hyperlink to launch a new page?

THANKS for your help!!! — Preceding unsigned comment added by (talk) 18:55, 9 January 2015 (UTC)

What browser do you use? In Firefox I right-click on a link and select "Open Link in New Tab". A click with the middle mouse button does this too. -- John of Reading (talk) 19:08, 9 January 2015 (UTC)
(edit conflict) Wikipedia has no way to specify this for others who click a link. Your browser probably has a feature to do it for you, maybe Ctrl+click or Shift+click. Registered users have the option "Open external links in a new tab/window" at Special:Preferences#mw-prefsection-gadgets. PrimeHunter (talk) 19:11, 9 January 2015 (UTC)

Short urls[edit]

How can we create a short url of a Wikipedia article for Twitter? Snurl wouldn't cut it.Oceanflynn (talk) 16:39, 6 March 2015 (UTC)

If snurl doesn't cut it then use another service like at URL shortening#URL shortening services. I have just created for as a test. URL shortening services are blacklisted as external links in Wikipedia (for good reasons) so I couldn't save tiny.url as a clickable link. PrimeHunter (talk) 17:52, 6 March 2015 (UTC)
I don't have a Twitter account and don't know what they actually allow but if you still have problems then the place to ask is Wikipedia:Reference desk/Computing. PrimeHunter (talk) 18:01, 6 March 2015 (UTC)
By clicking "Permanent link" in the left pane of a Wikipedia page you can get a link to the latest revision of that page. See Help:Permanent link. If the page is edited later then the link will still go to the version at the time of your click. The url is long but can be shortened. For URL shortening I currently get Testing shows it can be reduced to I give no guarantee such url's will continue to work, and it will fail with no trace of the page name if that revision is deleted for some reason. is currently a redirect to (also no guarantee this will continue), so works now. PrimeHunter (talk) 18:20, 6 March 2015 (UTC)
If you want the current revision of the same page, try which is shorter by two characters. --Redrose64 (talk) 19:51, 6 March 2015 (UTC)
Nice. I wondered whether the page ID could be used in a link. The ID can be found by clicking "Page information" in the left pane. curid is not documented at Help:URL#URLs of Wikipedia pages but it is at mw:Manual:Parameters to index.php. Newer pages have 8-digit ID's. PrimeHunter (talk) 01:00, 7 March 2015 (UTC)
I'm a little surprised that the slash after the domain can also be dropped, at least in my tests where works, both when clicked and when copy-pasted to the browser address bar. I don't know how stable it is but it worked in all five tested browsers. PrimeHunter (talk) 01:10, 7 March 2015 (UTC)
I have added mention of this to the page.[5] PrimeHunter (talk) 00:27, 9 March 2015 (UTC)
Perhaps it's worth mentioning somewhere that in a Wikipedia query string, the oldid= parameter overrides curid=, as does a diff= with numeric value; and that curid= overrides title= --Redrose64 (talk) 14:44, 9 March 2015 (UTC)