No-one? I've gone through all the help pages I can find a second time and I still can't get it to work.
-- View this message in context: http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5010990... Sent from the WikiMedia General mailing list archive at Nabble.com.
Have you gone through the guides at http://www.mediawiki.org/wiki/Manual:Short_URL, or more specifically http://www.mediawiki.org/wiki/Manual:Short_URL/Apache? If you did what doesn't work or at what point do you have issues?
On 10 August 2013 19:27, Sarah Brdberry knittingand@gmail.com wrote:
No-one? I've gone through all the help pages I can find a second time and I still can't get it to work.
-- View this message in context: http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5010990... Sent from the WikiMedia General mailing list archive at Nabble.com.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Thanks for the reply. It seems my original post may have only gone to the web archives and not out to the list.
I have tried every version of the redirect code I can find. Short URLS are working but redirecting from the long version goes to index.php instead of the article name
I have recently moved my wiki from http://www.knitting-and.com/wiki to http://www.knitting-and.com/w and want the entries to still show at http://www.knitting-and.com/wiki
I've set up the redirects following the info at http://www.mediawiki.org/wiki/Manual:Short_URL but I've done something wrong and I can't figure out what
Full URLs such as http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage) are redirecting to http://www.knitting-and.com/wiki/index.phphttp://www.knitting-and.com/index.php instead of http://www.knitting-and.com/wiki/Lacy_Gloves_(Vintage)
I have the following in the .htaccess file in my root directory:
RewriteEngine On RewriteBase /~myusername RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/?wiki(/.*)?$ /w/index.php [L]
and this in my LocalSettings.php in the "w" directory
$wgScriptPath = "/w"; $wgScriptExtension = ".php"; $wgArticlePath = "/wiki/$1"; $wgUsePathInfo = true;
Any help would be greatly appreciated!
Sarah
On 11 August 2013 10:15, Dave Humphrey dave@uesp.net wrote:
Have you gone through the guides at http://www.mediawiki.org/wiki/Manual:Short_URL, or more specifically http://www.mediawiki.org/wiki/Manual:Short_URL/Apache? If you did what doesn't work or at what point do you have issues?
A few things you can check/try:
1) Make sure your Apache rewrite engine and htaccess use is on and working (ex: change the rewrite rule to something more obvious/different). 2) The rewrite rules you have are slightly different than the ones specified in the tutorial:
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L] RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
The RewriteCond's are optional and shouldn't make a difference but you can try removing them. Is the RewriteBase line there correct for your setup? 3) If you have access to the Apache root configuration you can try using Alias instead like I do (I don't believe you can use Alias in a .htaccess file): Alias /wiki /home/absolute/path/www/w/index.php Alias /index.php /home/absolute/path/www/w/index.php #Optional Obviously substitute your wiki's absolute path on the right side of the alias.
On 10 August 2013 20:25, Sarah Bradberry knittingand@gmail.com wrote:
Thanks for the reply. It seems my original post may have only gone to the web archives and not out to the list.
I have tried every version of the redirect code I can find. Short URLS are working but redirecting from the long version goes to index.php instead of the article name
I have recently moved my wiki from http://www.knitting-and.com/wiki to http://www.knitting-and.com/w and want the entries to still show at http://www.knitting-and.com/wiki
I've set up the redirects following the info at http://www.mediawiki.org/wiki/Manual:Short_URL but I've done something wrong and I can't figure out what
Full URLs such as http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage) are redirecting to http://www.knitting-and.com/wiki/index.php< http://www.knitting-and.com/index.php%3E instead of http://www.knitting-and.com/wiki/Lacy_Gloves_(Vintage)
I have the following in the .htaccess file in my root directory:
RewriteEngine On RewriteBase /~myusername RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/?wiki(/.*)?$ /w/index.php [L]
and this in my LocalSettings.php in the "w" directory
$wgScriptPath = "/w"; $wgScriptExtension = ".php"; $wgArticlePath = "/wiki/$1"; $wgUsePathInfo = true;
Any help would be greatly appreciated!
Sarah
On 11 August 2013 10:15, Dave Humphrey dave@uesp.net wrote:
Have you gone through the guides at http://www.mediawiki.org/wiki/Manual:Short_URL, or more specifically http://www.mediawiki.org/wiki/Manual:Short_URL/Apache? If you did what doesn't work or at what point do you have issues?
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
On 11 August 2013 10:56, Dave Humphrey [via Wikimedia] < ml-node+s7n5010997h39@n6.nabble.com> wrote:
A few things you can check/try:
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L] RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
I just gave it a go but it's returning a 404 error if you try and look at a wiki page with a long url.
If I use the short URL code from http://www.mediawiki.org/wiki/Manual:Short_URL it will return http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage) with a 404 or http://www.knitting-and.com/w/index.php?title=Lacy_Gloves_(Vintage)http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage) with the correct page but a long url
I don't have access to the apache root configuration.
-- View this message in context: http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5011000... Sent from the WikiMedia General mailing list archive at Nabble.com.
both short and long urls are working for me
On Sat, Aug 10, 2013 at 9:16 PM, Sarah Bradberry knittingand@gmail.comwrote:
On 11 August 2013 10:56, Dave Humphrey [via Wikimedia] < ml-node+s7n5010997h39@n6.nabble.com> wrote:
A few things you can check/try:
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L] RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
I just gave it a go but it's returning a 404 error if you try and look at a wiki page with a long url.
If I use the short URL code from http://www.mediawiki.org/wiki/Manual:Short_URL it will return http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)with a 404 or http://www.knitting-and.com/w/index.php?title=Lacy_Gloves_(Vintage)< http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)%3E with the correct page but a long url
I don't have access to the apache root configuration.
-- View this message in context: http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5011000... Sent from the WikiMedia General mailing list archive at Nabble.com. _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Long urls aren't redirecting to index.php?
On 11 August 2013 11:44, John phoenixoverride@gmail.com wrote:
both short and long urls are working for me
On Sat, Aug 10, 2013 at 9:16 PM, Sarah Bradberry <knittingand@gmail.com
wrote:
On 11 August 2013 10:56, Dave Humphrey [via Wikimedia] < ml-node+s7n5010997h39@n6.nabble.com> wrote:
A few things you can check/try:
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L] RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
I just gave it a go but it's returning a 404 error if you try and look
at
a wiki page with a long url.
If I use the short URL code from http://www.mediawiki.org/wiki/Manual:Short_URL it will return
http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)with
a 404 or http://www.knitting-and.com/w/index.php?title=Lacy_Gloves_(Vintage)< http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)%3E with the correct page but a long url
I don't have access to the apache root configuration.
-- View this message in context:
http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5011000...
Sent from the WikiMedia General mailing list archive at Nabble.com. _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Sorry, I changed it back to what I originally had because of the high amount of traffic I have on short urls.
So it was short urls working, long urls redirecting to index.php with the current setup (.htaccess and LocalSettings that I originally posted).
On 11 August 2013 12:31, Sarah Bradberry knittingand@gmail.com wrote:
Long urls aren't redirecting to index.php?
On 11 August 2013 11:44, John phoenixoverride@gmail.com wrote:
both short and long urls are working for me
On Sat, Aug 10, 2013 at 9:16 PM, Sarah Bradberry <knittingand@gmail.com
wrote:
On 11 August 2013 10:56, Dave Humphrey [via Wikimedia] < ml-node+s7n5010997h39@n6.nabble.com> wrote:
A few things you can check/try:
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L] RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
I just gave it a go but it's returning a 404 error if you try and look
at
a wiki page with a long url.
If I use the short URL code from http://www.mediawiki.org/wiki/Manual:Short_URL it will return
http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)with
a 404 or http://www.knitting-and.com/w/index.php?title=Lacy_Gloves_(Vintage)< http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)%3E with the correct page but a long url
I don't have access to the apache root configuration.
-- View this message in context:
http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5011000...
Sent from the WikiMedia General mailing list archive at Nabble.com. _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
-- Knitting and crafts - online for over 17 years! http://knitting-and.com Craft videos http://youtube.com/knittingand Cooking videos http://youtube.com/thevintagekitchen
I just thought of something that is probably the problem (smacking myself in the forehead here).
I originally set up the wiki infrastructure at knitting-and.com/wiki People linked to the long form of URLs there I set up short urls - the incoming long urls were working & redirecting to the short versions
I moved the wiki infrastructure to knitting-and.com/w with articles at knitting-and.com/wiki Long urls are coming into the OLD wiki long URLs at knitting-and.com/wiki/ So I need to set up the old version of the long urls from knitting-and.com/wiki/ to redirect as well as the current version.
Does that sound right or completely insane?
On 11 August 2013 12:33, Sarah Bradberry knittingand@gmail.com wrote:
Sorry, I changed it back to what I originally had because of the high amount of traffic I have on short urls.
So it was short urls working, long urls redirecting to index.php with the current setup (.htaccess and LocalSettings that I originally posted).
On 11 August 2013 12:31, Sarah Bradberry knittingand@gmail.com wrote:
Long urls aren't redirecting to index.php?
On 11 August 2013 11:44, John phoenixoverride@gmail.com wrote:
both short and long urls are working for me
On Sat, Aug 10, 2013 at 9:16 PM, Sarah Bradberry <knittingand@gmail.com
wrote:
On 11 August 2013 10:56, Dave Humphrey [via Wikimedia] < ml-node+s7n5010997h39@n6.nabble.com> wrote:
A few things you can check/try:
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L] RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]
I just gave it a go but it's returning a 404 error if you try and
look at
a wiki page with a long url.
If I use the short URL code from http://www.mediawiki.org/wiki/Manual:Short_URL it will return
http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)with
a 404 or http://www.knitting-and.com/w/index.php?title=Lacy_Gloves_(Vintage)< http://www.knitting-and.com/wiki/index.php?title=Lacy_Gloves_(Vintage)
with the correct page but a long url
I don't have access to the apache root configuration.
-- View this message in context:
http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5011000...
Sent from the WikiMedia General mailing list archive at Nabble.com. _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
-- Knitting and crafts - online for over 17 years! http://knitting-and.com Craft videos http://youtube.com/knittingand Cooking videos http://youtube.com/thevintagekitchen
-- Knitting and crafts - online for over 17 years! http://knitting-and.com Craft videos http://youtube.com/knittingand Cooking videos http://youtube.com/thevintagekitchen
Sounds about right. Right now there is no such thing as /wiki/index.php since you moved to /w/index.php. So /wiki/index.php is being treated as the page linked to by [[index.php]]. But the url for that is wrong since the proper key for that title is [[Index.php]] because by default [[foo]] and [[Foo]] are the same page. So MW is redirecting to the upper-case version at /wiki/Index.php. And the query is being discarded because the only thing inside it is the ?title=... (see what happends when you go to https://en.wikipedia.org/w/index.php?title=wikipedia). Ideally you'd have never used /wiki/index.php in the first place, but too it's late for that.
Now the path router I introduced that now handles short urls is fairly flexible. I haven't tested it but to experiment try adding this to your LocalSettings.php.
$wgHooks['WebRequestPathInfoRouter'] = function( $router ) { $router->addStrict( "/wiki/index.php", array( 'title' => false ) ); $router->add( "/wiki/index.php/$1" ); return true; };
The other, classic way to fix this of course would simply be a rewrite rule to 301 redirect all /wiki/index.php paths to /w/index.php.
The site is redirecting just fine.
You said:
I have recently moved my wiki from http://www.knitting-and.com/wiki to http://www.knitting-and.com/w and
want
the entries to still show at http://www.knitting-and.com/wiki
They are and all short URL work fine. I am guessing from your original statement, you changed directories.
http://www.knitting-and.com/wiki/Main_Page and any short URL I browse to.
I believe you're thinking wiki/index.php?.... instead of w/index.php?....
Since you changed your directory from /wiki to /w, the long URLs are now...
http://www.knitting-and.com/w/index.php?title=Main_Page and it works just fine. /wiki is a rewritten fake directory now, it doesn't really exist.
If you call /wiki/index.php?.... whatever, anything after the ? is truncated and index.php shows up as a 404, uncreated article. This behavior is correct. Rewrite is parsing and preforming correctly as far as I can tell. Even &action=edit shows me the source of a page.
Tom
Thanks, that's what I suddenly just realised too (hence the smacking myself in the forehead) :P
So I'm guessing the best thing to do is either contact the owners of the sites with bad links and getting them to change them (if the sites are still updated) is my best option.
Thanks for your help!
On 11 August 2013 13:00, Tom Hutchison [via Wikimedia] < ml-node+s7n5011010h42@n6.nabble.com> wrote:
The site is redirecting just fine.
You said:
I have recently moved my wiki from http://www.knitting-and.com/wiki to http://www.knitting-and.com/w and
want
the entries to still show at http://www.knitting-and.com/wiki
They are and all short URL work fine. I am guessing from your original statement, you changed directories.
http://www.knitting-and.com/wiki/Main_Page and any short URL I browse to.
I believe you're thinking wiki/index.php?.... instead of w/index.php?....
Since you changed your directory from /wiki to /w, the long URLs are now...
http://www.knitting-and.com/w/index.php?title=Main_Page and it works just fine. /wiki is a rewritten fake directory now, it doesn't really exist.
If you call /wiki/index.php?.... whatever, anything after the ? is truncated and index.php shows up as a 404, uncreated article. This behavior is correct. Rewrite is parsing and preforming correctly as far as I can tell. Even &action=edit shows me the source of a page.
Tom
MediaWiki-l mailing list [hidden email] http://user/SendEmail.jtp?type=node&node=5011010&i=0 https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
If you reply to this email, your message will be added to the discussion below:
http://wikimedia.7.x6.nabble.com/Need-Help-with-Short-URLs-tp5010861p5011010... To unsubscribe from Need Help with Short URLs, click herehttp://wikimedia.7.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5010861&code=a25pdHRpbmdhbmRAZ21haWwuY29tfDUwMTA4NjF8LTE1MDMzNzQ2MDg= . NAMLhttp://wikimedia.7.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
mediawiki-l@lists.wikimedia.org