Is there an option to select a redirect from a different domain?
About this board
Previous page history was archived for backup purposes at Extension talk:ShortUrl/LQT Archive 1 on 2015-07-10.
How to use with different domain
permalink as limited alternative to ShortUrl
In case others find the suggestion useful, I'll mention that I have found it sufficient to use permalinks in email for page revisions on my wiki that have long titles, rather than arrange to get this extension installed.
For example, it's nice that the Hindi-language page about the Hindi Wikipedia is at <http://hi.wikipedia.org/s/164>. However, if that were not the case, it would still be nearly as useful that its present revision can be accessed via <http://hi.wikipedia.org/w/?oldid=1902067>. (I don't know any Hindi at all. I only knew that this extension is installed on that language version of Wikipedia.)
I am not placing this suggestion on the extension's page. When I mentioned it a short while ago in IRC #mediawiki, I found that it might not meet with consensus.
You can actually use even http://hi.wikipedia.org/?oldid=1902067 . However, what you actually want is curid; see also bugzilla:21572.
Thanks! Here's what I learned from that bugzilla item.
In some cases, a "curid" link will be confusing.
- By the time the link is used, the page with that "curid" value may have been renamed.
- By the time the link is used, the page with that "curid" value may have new text.
The page's new text might pertain to a different concept, as compared with the old text.
- It could be a disambiguation page, when it used to be an article.
- It could be an article, but now pertaining to a different meaning of the same title. It could be as different as a river "bank" is from a savings "bank".
- With both renamings and revisions, it could even be an article about a different meaning of a different title.
To create a "curid" link, first get the "curid" value.
- Use any of the usual software products for web browsing, such as Google Chrome.
- Open the page that will be the target of the link.
- Use the command called View Source, or View Page Source.
- Find the text "wgArticleId".
- That will be followed by a colon, then a number. That number is the "curid" value.
Then use the "curid" value in a link.
- For the English-language Wikipedia, you can paste the "curid" number onto the end of this: https://en.wikipedia.org?curid=
- Equivalently, you can do this:
- Go to the site's "Special pages" list. The site provides a link to Special Pages in the Tools section of the sidebar.
- On the page "Special Pages", use the link "Redirect by file, user, page, revision, or log ID".
- In the Lookup pop-down list, select "Page ID".
- In the Value text box, paste the "curid" value.
- Press "Go".
the path for generating short URLs
Statement Set $wgShortUrlTemplate to the template of the path for generating short URLs. $1 is replaced with the actual short url id. should be explained. I have installed this the ShortUrl extension at http://mizugadro.mydns.jp/q/index.php/Special:Version but it does not work. I added line $wgShortUrlTemplate= "http://mizugadro.mydns.hp/k" at the end of the LocalSetting.php
expecting, that instead of http://mizugadro.mydns.hp/q/index.php/test
I can type simply http://mizugadro.mydns.hp/k/test
but I see, this does not work. When, where and how should I specify the desired short URL for this wiki to make it work? Should I create directory http://mizugadro.mydns.hp/k ? Should I put there some files? How to quess, which files should be placed there?
Some sentences or paragraphs seem to be missed between statements "Set $wgShortUrlTemplate to the template of the path for generating short URLs." and "$1 is replaced with the actual short url id."
Could you recover, please the missed explanation?
Pinging @Yuvipanda: as they are the user listed as the author.
I know this one is old as heck, but here is the answer:
If, for instance, you have your MediaWiki on "wiki.com" domain, and you have $wgArticlePath = "/wiki/$1" (you can check that in LocalSettings.php file), and you want you short links to look like "wiki.com/wiki/short/_shortname_", your $wgShortUrlTemplate would look like this:
For some reason I am unable to post this into the article directly, maybe somebody else could do it?
Install for more wikis
I think this extension should be install for some of others wiki also use length url which diffcult for share and read as Russian or Vietnamese.
See example for: "Korean War" in 4 languages:
- English: https://en.wikipedia.org/wiki/Korean_War
- Vietnamese: https://vi.wikipedia.org/wiki/Chi%E1%BA%BFn_tranh_Tri%E1%BB%81u_Ti%C3%AAn
- Russian: https://ru.wikipedia.org/wiki/%D0%9A%D0%BE%D1%80%D0%B5%D0%B9%D1%81%D0%BA%D0%B0%D1%8F_%D0%B2%D0%BE%D0%B9%D0%BD%D0%B0
- Japanese: https://ja.wikipedia.org/wiki/%E6%9C%9D%E9%AE%AE%E6%88%A6%E4%BA%89
There's some work happening to get ShortURL deployed on Wikimedia wikis. (T108557) Follow that task to keep up-to-date on development.
I don't know if you knew or not, but MediaWiki saw an update recently that makes URLs a little cleaner (copy/pasting might depend on browser if I recall correctly), it even works with section IDs! Not perfect, but better.
URLs of a minimum length?
Is there a way to edit the code so that it generates short URLs of a minimum length? Say 5 or so instead of 2.
ShortUrl and Semantic Mediawiki
Extension:SemanticMediaWiki and Extension:SemanticForms don't work correctly after installing ShortUrl:
- page Special:Properties (SMW) contains “NO_VALID_VALUE” instead of the names of predefined properties;
- page Special:CreateProperty (SF) displays a message “This appears to be a cross-site request forgery; canceling save” when you try to save or preview property
I was able to fix it by editing the function setupUrlRouting (ShortUrl.hooks.php): replaced
$router->add( $wgShortUrlTemplate, array( 'title' => SpecialPage::getTitleFor( 'ShortUrl', '$1' )->getPrefixedText() ) );
$router->add( $wgShortUrlTemplate, array( 'title' => 'Special:ShortUrl/$1' ) );
After that everything is working correctly.
How about this?
$router->add( $wgShortUrlTemplate, array( 'title' => SpecialPage::getTitleFor( 'ShortUrl', false, '$1' )->getPrefixedText() ) );
The current UI of the extension is really bad. It is:
- Obtrusive (lying just below the heading)
- Confusing: Since the url is not accompanied by any indication that this is the url for the current page, half the people (those who don't bother clicking it) probably have no idea what it is for.
- Clickable: I'm not sure if having a clickable link is needed, since the objective of having a short url is to be able to copy-paste it somewhere.
I'd suggest that the url be moved somewhere more unobtrusive, and be presented with a heading/info (similar to what other sites use, such as "Link to this page"). One way could be such a tag (like "Link to this page") displayed somewhere prominently, clicking on which brings up a dialog box (jquery.ui.dialog maybe?) with the url selected for copying (along with a copy button, maybe?). I don't think there is a need for the url to be permanently displayed on the page.
PS:I don't see why we need the short url displayed at two places (in the sidebar as well as below the heading).
I agree, this is among the ugliest extensions ever. :) See bugzilla:38863.
I agree, though I'll note that it was mainly written as a direct replacement of the userscripts on a few indian wikis (or and ta, I think) that were being used a few years ago when I started on it.
Database table need to be set up manually?
It seems to me like the maintainence script does not create the needed database table? If that is the case, it would be nice with a line or two about how the table should be set up. rotsee (talk) 20:00, 19 February 2012 (UTC)
in case someone else is looking, it's all in the folder ”schemas”. I somehow didn't notice that.
You can also run the mediawiki maintenance script. I have updated the documentation - https://www.mediawiki.org/wiki/Extension:ShortUrl#Installation
Even easier... Thanks! It's working really great, I even wrote a short blog post about it: http://blog.xn--ssongsmat-v2a.nu/2012/02/20/creating-a-url-shortener-with-mediawiki/
Not yet ready for deployment
Just a note: this extension has been reviewed for deployment and there are still some things that need doing before it can be deployed on Wikimedia Foundation wikis. Please see https://bugzilla.wikimedia.org/show_bug.cgi?id=1450 for details.
Just a follow up - those things that were blocking deployment have now been fixed.
Is there a reference or test installation ?
Hi, where can I find a wiki having the ShortUrlUrl extension activated?
No, not that I know of.