Help talk:URL
Wikipedia Help NA‑class | |||||||
|
Text and/or other creative content from Meta:Help:URL was copied or moved into Help:URL with this edit. The former page's history now serves to provide attribution for that content in the latter page, and it must not be deleted as long as the latter page exists. |
|
|
Encoding
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: http://en.wikipedia.org/wiki/^
The apostrophe really applies to sequential use, as it gets parsed as wikimarkup: http://en.wikipedia.org/wiki/12345
The pipe automatically gets encoded: http://en.wikipedia.org/wiki/%7C
---— Gadget850 (Ed) talk 21:57, 7 April 2011 (UTC)
"="sign
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]
- ^ [http://www.sgilibrary.org/view.php?page=1052 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]
- ^ [http://www.sgilibrary.org/view.php?page%3D1052 The Doctrine of Attaining Buddhahood in One’s Present Form]
Using {{=}} doesn't work either: [1]
- ^ [http://www.sgilibrary.org/view.php?page=1052 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:
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, https://www.google.com/search?q=feral works but https://www.google.com/search?q%3dferal doesn't. In an unnamed parameter neither of them work: {{{1}}}(the source has a template here) and https://www.google.com/search?q%3dferal 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)
HTTPS changes
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)
- [scroogle.org 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 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 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! Most forums these days and social networks catch any mention of .whatever and parse it as a link 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 Blackle.com 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? Definitely a lot more convenient for people when browsers are starting to phase out http:// --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://
- 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)
- 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? Definitely a lot more convenient for people when browsers are starting to phase out http:// --Mistress Selina Kyle (Α⇔Ω ¦ ⇒✉) 12:22, 12 February 2012 (UTC)
- 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:// 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! --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)
- http:// is a URI scheme, not a TLD (which would be
- 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:// 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! --Mistress Selina Kyle (Α⇔Ω ¦ ⇒✉) 12:07, 15 February 2012 (UTC)
- I know, that's why I said "something .TLD is always going to be http" — there is no . in http://
- 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?
Wiki-text markup treats a final right parenthesis in special ways. Consider:
- (http://www.example.com) closing parenthesis is NOT part of the link
- (http://www.example.com/parens=()
- (http://www.example.com/parens=())
- http://www.example.com/some/more) closing parenthesis is NOT part of the link.
- http://www.example.com/some(/more)
- http://www.example.com/some(/more)/and/more)
- http://www.example.com/some(/more)/and(/more)
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.
- 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
unescapedunencoded. 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: http://en.citizendium.org/wiki/Theory_(mathematics) is a valid link, and the parentheses do NOT need to be escaped. Blevintron (talk) 21:57, 23 April 2012 (UTC)
- No, this is a different concern than encoding. These characters are allowed within URLs
Unsupported?
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
For some reason {{urlencode:test test}} (now) gives test+test not test%20test as advertised on this help page. /37.197.83.144 (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 http://test.com?test test then the required url is [2] but using urlencode as suggested we get [3]. 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. /37.197.83.144 (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. /37.197.83.144 (talk) 16:11, 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:
- 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 http://test.com?test test then the required url is [2] but using urlencode as suggested we get [3]. 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. /37.197.83.144 (talk) 15:09, 31 July 2013 (UTC)
Open a new page with a hyperlink
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 72.37.249.100 (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)