MediaWiki running PHP-CGI and using Pretty URLs

MediaWiki running PHP-CGI and using Pretty URLs

Posted by: dougnoel
Posted on: 2006-09-02 18:57:00

I have the following setup:

* MediaWiki: 1.7.1
* PHP: 5.1.2 (cgi-fcgi)
* MySQL: 5.0.18-standard-log

If I put this in .htaccess:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?title=$1 [L,QSA]

Then the URL cannot be resolved. If I change the following line in LocalSettings.php:

$wgScript = "$wgScriptPath/index.php";
#$wgScript = "$wgScriptPath";

It resolves correctly, but points to the root directory (where the PHPBB resides) instead of the wiki. Three of us have tried to resolve this issue. I would aprpeicate any help anyone can give!

Thanks,
Doug

Re: MediaWiki running PHP-CGI and using Pretty URL

Posted by: dougnoel
Posted on: 2006-09-02 19:14:00

Solved my own problem. writing it out helped. My issue was I needed to change this line:

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

to this:

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

Here are the full steps I followed:

Edit (or create) a file called .htaccess in the /wiki directory and put the following lines in:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /wiki/index.php?title=$1 [L,QSA]

Then in LocalSettings.php comment out:
#$wgScript = "$wgScriptPath/index.php";

And Add:
#Change to make pretty URLs work
$wgScript = "$wgScriptPath";

Then swap the comment on following lines to look as follows:
$wgArticlePath = "$wgScript/$1";
#$wgArticlePath = "$wgScript?title=$1";

Tags: php cgiphp 5fcgiqsaindexmediawikiwikiroot directoryhtaccessurlsresolvephpbbmysqlrunningurl