Mailing List Archive

Rewrite rules and login link
I have rewrite working. It's great. Except....

The link at the top of the page isn't giving the "Special:Userlogin" link
that works...but rather appending it as a query string like so:
"Main_Page?title=Special:Userlogin&returnto=Main_Page"....and this link does
nothing. Reloads Main_Page...that's it.

.htaccess:
php_flag register_globals off

RewriteEngine on

RewriteRule ^$ /index.php [L]

RewriteCond %{REQUEST_URI} !^/(stylesheets|images|skins)/
RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index).php
RewriteCond %{REQUEST_URI} !^/error/(40(1|3|4)|500).html
RewriteCond %{REQUEST_URI} !^/favicon.ico
RewriteCond %{REQUEST_URI} !^/robots.txt

RewriteCond %{QUERY_STRING} ^$ [OR] RewriteCond %{REQUEST_URI}
^/wiki/Special:Search

RewriteRule ^(.*)$ /index.php/$1 [L,QSA]

LocalSettings.php:
$wgSitename = "Sitename";
$wgServer = "http://www.foo.org";

$wgScriptPath = "";
$wgScript = "$wgScriptPath";
$wgRedirectScript = "$wgScriptPath/redirect.php";

$wgArticlePath = "$wgScript/$1";

$wgStylePath = "$wgScriptPath/stylesheets";
$wgStyleDirectory = "$IP/stylesheets";
$wgLogo = "$wgStylePath/images/wiki.png";

$wgUploadPath = "/images";
$wgUploadDirectory = "$IP/images";

Any help?

Josh
Re: Rewrite rules and login link [ In reply to ]
On Nov 20, 2004, at 11:50 PM, Joshua Rochester wrote:
> The link at the top of the page isn't giving the "Special:Userlogin"
> linkthat works...but rather appending it as a query string like so:
> "Main_Page?title=Special:Userlogin&returnto=Main_Page"....and this
> link doesnothing. Reloads Main_Page...that's it.
[snip]
> $wgScriptPath = "";
> $wgScript = "$wgScriptPath";

Set $wgScriptPath to point to the actual script (eg, "/index.php').

-- brion vibber (brion @ pobox.com)
Re: Rewrite rules and login link [ In reply to ]
No dice. That just broke everything depending on the rewrites.

A little more information:

The problem only seems to exist on the links that have an added query param,
for instance....

Link to Preferences:
http://www.foo.org/Special:Preferences

Link to Log Out:
http://www.foo.org/Main_Page?title=Special:Userlogout&returnto=Main_Page

Link to What Links Here:
http://www.foo.org/Main_Page?title=Special:Whatlinkshere&target=Main_Page

The link works when it is like so:
http://www.foo.org/?title=Special:Whatlinkshere&target=Main_Page

Either the rewrite rules need a fix, or the prefs do....

Josh


Those links should be to

On 11/20/04 11:56 PM, "Brion Vibber" <brion@pobox.com> wrote:

> On Nov 20, 2004, at 11:50 PM, Joshua Rochester wrote:
>> The link at the top of the page isn't giving the "Special:Userlogin"
>> linkthat works...but rather appending it as a query string like so:
>> "Main_Page?title=Special:Userlogin&returnto=Main_Page"....and this
>> link doesnothing. Reloads Main_Page...that's it.
> [snip]
>> $wgScriptPath = "";
>> $wgScript = "$wgScriptPath";
>
> Set $wgScriptPath to point to the actual script (eg, "/index.php').
>
> -- brion vibber (brion @ pobox.com)
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l@Wikimedia.org
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Re: Rewrite rules and login link [ In reply to ]
On Nov 21, 2004, at 12:24 AM, Joshua Rochester wrote:
> No dice. That just broke everything depending on the rewrites.

Sorry, I mistyped. Set *$wgScript* to the actual script (/index.php)

-- brion vibber (brion @ pobox.com)
Re: Rewrite rules and login link [ In reply to ]
These lines got me:
$wgScriptPath = "";
$wgScript = "$wgScriptPath/index.php";
$wgArticlePath = "$wgScriptPath/$1";

Everything is wonderful now.

Thanks for the help!
Josh

On 11/21/04 1:12 AM, "Brion Vibber" <brion@pobox.com> wrote:

> On Nov 21, 2004, at 12:24 AM, Joshua Rochester wrote:
>> No dice. That just broke everything depending on the rewrites.
>
> Sorry, I mistyped. Set *$wgScript* to the actual script (/index.php)
>
> -- brion vibber (brion @ pobox.com)
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l@Wikimedia.org
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l