Media Wiki and Mod Rewrite fails


#1

I’ve installed a Media Wiki and try to get pretty URLs by adding a .htaccess like this:

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

And also of course adding these lines to the MW LocalSettings.php:

Pretty URLs

$wgScriptPath = “/w”; # Physical path (right part of first rewrite rule). Should already be in LocalSettings.php
$wgArticlePath = “/wiki/$1”; # Virtual path (left part of first rewrite rule). MUST BE DIFFERENT from $wgScriptPath!
$wgLogo = “/wiki/File:Wiki.png”; # May need adjusted to where your logo is found. Without it your logo will disappear.

But I get a 500 Internal Server Error.

What am I doing wrong?


#2

800+ views and not a single reply. Am I invisible or are my questions either too hard or too irrelevant? I have three threads now in this forum and not a single answer to any of them (Ok, one has a SPAM reply). Is that normal in this support forum?


#3

Did you actually install it into a /w/ directory? I also don’t use the IfModule check lines.


#4

Uhmmm no! Thanks for the hint but now I removed the /w and it still doesn’t work. I have the Wiki installation in the domain’s root folder …

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

$wgScriptPath = “”; # Physical path (right part of first rewrite rule). Should already be in LocalSettings.php
$wgArticlePath = “/wiki/$1”; # Virtual path (left part of first rewrite rule). MUST BE DIFFERENT from $wgScriptPath!

Same error as before.


#5

My wiki is installed in the root directory of my site and my .htaccess looks like this:

enable the rewriter

RewriteEngine on

anything under /wiki is treated as an article title

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

(yes, that’s all I have in my htaccess) I’m not an htaccess expert, but I do notice that yours lacks the plus sign mine has and instead has an asterisk.

And my paths looks like:
$wgScriptPath = “/wiki”; # default value
$wgArticlePath = “${wgScriptPath}/$1”;


#6

Seems something was fishy about my .htaccess file! I’ve now copied the one from my Wordpress install and edited it and now this works flawless.[hr]

Thanks for the help!
As mentioned above I think something was strange about my .htaccess file. Now it looks like this and it works…

BEGIN Media Wiki

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

END Mediawiki