Hi,
My installation is here: http://wiki.themixingbowl.org/
I've recently upgraded from 1.9.3 to the latest 1.11.1 and I'm unable to make my short url's work correctly.
The standard /Article works fine (see http://wiki.themixingbowl.org/FAQ) but when the full URL is required - when a second $_GET variable needs to be passed (e.g. http://wiki.themixingbowl.org/w/index.php?title=Special:Userlogin&return...) mediawiki ignores the URL's. It's like only url's in the format of $wgArticlePath are recognised.
Basically, if I set $wgArticlePath = "/$1"; as it is at the moment then mediawiki failes to recognise the http://wiki.themixingbowl.org/w/index.php?title=Special:Userlogin&return... style of url's.
If I were to set $wgArticlePath = "$wgScript?title=$1"; (without changing my rewrite rules) then the URL http://wiki.themixingbowl.org/w/index.php?title=Special:Userlogin&return... will work fine.
These URL's worked fine with 1.9.3 but aren't working for me on 1.11.1.
Sorry for the waffle-y email but it's a difficult problem to explain (and to search for solutions for).
If I've left out any vital info to help diagnose the issue please let me know.
Many thanks
On 23/02/2008, Thomas Dalton thomas.dalton@gmail.com wrote:
I've recently upgraded from 1.9.3 to the latest 1.11.1 and I'm unable to make my short url's work correctly.
How are you doing the short urls? Copy and paste the appropriate lines.
LocalSettings.php $wgScriptPath = "/w"; $wgScript = "$wgScriptPath/index.php"; $wgRedirectScript = "$wgScriptPath/redirect.php"; $wgArticlePath = "/$1";
Apache httpd.conf RewriteEngine on RewriteRule ^/w/.*$ - [L] RewriteRule ^/$ /w/index.php?title=Main_Page [L,QSA] RewriteRule ^(.+)$ /w/index.php?title=$1 [L,QSA]
It's set up like this at the moment but I've tried lots of different ways. Originally, before the upgrade it was like this: RewriteRule ^/robots.txt$ /robots.txt [L] RewriteRule ^/favicon.ico$ /favicon.ico [L] RewriteRule ^/w/(.*) /w/$1 [L] # This enables "Wikipedia-style" URLs RewriteRule ^/wiki$ http://wiki.themixingbowl.org/wiki/ [R,L] RewriteRule ^/wiki/(.*) /w/index.php/$1 [L] RewriteRule ^/wiki/index.php(.*) /w/index.php$1 [L] RewriteRule ^/$ /w/index.php/Main_Page [L] RewriteRule ^/Main_Page$ http://wiki.themixingbowl.org/ [R=permanent,L] # Finally, if we've gotten this far, process it as if it's an article. RewriteRule ^/(.*) /w/index.php/$1 [L]
But, as noted in the original post I do not beleive that the re-write rules are at fault as: a) It worked fine before the upgrade b) If I leave the rewrite rules then set $wgArticlePath = "$wgScript?title=$1"; then URL's of the format (http://wiki.themixingbowl.org/w/index.php?title=Special:Userlogin&return...) work fine again.
Thanks for your time
b) If I leave the rewrite rules then set $wgArticlePath = "$wgScript?title=$1"; then URL's of the format (http://wiki.themixingbowl.org/w/index.php?title=Special:Userlogin&return...) work fine again.
This seems odd to me... as far as I know, $wgArticlePath is only used when automatically generating links, it shouldn't have any affect when going directly to a URL. You should probably have it set to "/wiki/$1" rather than just "/$1", though, otherwise you'll have problems with articles called things like "w/" or "robots.txt".
On 23/02/2008, Thomas Dalton thomas.dalton@gmail.com wrote:
b) If I leave the rewrite rules then set $wgArticlePath = "$wgScript?title=$1"; then URL's of the format (http://wiki.themixingbowl.org/w/index.php?title=Special:Userlogin&return...) work fine again.
This seems odd to me... as far as I know, $wgArticlePath is only used when automatically generating links, it shouldn't have any affect when going directly to a URL. You should probably have it set to "/wiki/$1" rather than just "/$1", though, otherwise you'll have problems with articles called things like "w/" or "robots.txt".
Very odd! Looking at webrequest.php I've found a way to fix it (for small values of fix ;-)) To stop it matching on url's that start /w/blahblah I've added this to the start of extractTitle global $wgScriptPath; if (strpos($path, $wgScriptPath.'/') === 0) { return array(); }
Which is horrible I know but at least it's now working + I know where it's going wrong. Basically extractTitle is matching when my url's begin /w/index.php?title=blah when I'm guessing it probably shouldn't.
Any advice to fix it properly so I can remove my hack would be greatly appreciated.
Many thanks
On 23/02/2008, coptang@gmail.com coptang@gmail.com wrote:
On 23/02/2008, Thomas Dalton thomas.dalton@gmail.com wrote:
b) If I leave the rewrite rules then set $wgArticlePath = "$wgScript?title=$1"; then URL's of the format (http://wiki.themixingbowl.org/w/index.php?title=Special:Userlogin&return...) work fine again.
This seems odd to me... as far as I know, $wgArticlePath is only used when automatically generating links, it shouldn't have any affect when going directly to a URL. You should probably have it set to "/wiki/$1" rather than just "/$1", though, otherwise you'll have problems with articles called things like "w/" or "robots.txt".
Very odd! Looking at webrequest.php I've found a way to fix it (for small values of fix ;-)) To stop it matching on url's that start /w/blahblah I've added this to the start of extractTitle global $wgScriptPath; if (strpos($path, $wgScriptPath.'/') === 0) { return array(); }
Which is horrible I know but at least it's now working + I know where it's going wrong. Basically extractTitle is matching when my url's begin /w/index.php?title=blah when I'm guessing it probably shouldn't.
Any advice to fix it properly so I can remove my hack would be greatly appreciated.
Many thanks
Bump ;-)
Any advice on this one or is there another list I should be asking on? I assume that it shouldn't be a bug as it's working fine on the mediawiki site (albeit in a slightly different way).
Thanks
coptang@gmail.com wrote:
Which is horrible I know but at least it's now working + I know where it's going wrong. Basically extractTitle is matching when my url's begin /w/index.php?title=blah when I'm guessing it probably shouldn't.
Any advice to fix it properly so I can remove my hack would be greatly appreciated.
Try 1.12 from SVN; some changes were made to path expansion which may help your case:
http://svn.wikimedia.org/svnroot/mediawiki/branches/REL1_12/phase3
-- brion vibber (brion @ wikimedia.org)
On 27/02/2008, Brion Vibber brion@wikimedia.org wrote:
Try 1.12 from SVN; some changes were made to path expansion which may help your case:
Thanks, will give that a try at the weekend.
mediawiki-l@lists.wikimedia.org