PDA

View Full Version : MediaWiki: getting rid of index.php


Gerrit
06-23-2005, 03:43 PM
Hi!


I've installed MediaWiki to a subdomain (DS-IRM) at FutureQuest and everything works fine.

The last thing to do is getting rid of "index.php" to get nice URIs like http://sub.domain.tld/Main_Page instead of: http://sub.domain.tld/index.php/Main_Page

Index.php (and the rest) of MediaWiki resides at: /big/dom/xdomain/www/wiki and the DS-IRM points there too.

I've tried several of the ideas at: http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url and http://meta.wikimedia.org/wiki/Talk:Eliminating_index.php_from_the_url ... but always produce a 500-server-error.


Questions:

1. Did anyone else install MediaWiki to a DS-IRM and eliminated the "index.php/" from URIs? If yes: how?

2. Is it possible (for me or FQ) to manipulate the httpd.conf and set aliases as described in the article above?


Smile!..
Gerrit

Terra
06-23-2005, 04:12 PM
2. Is it possible (for me or FQ) to manipulate the httpd.conf and set aliases as described in the article above?
No... Alias would not work with DS:IRMs due to the virtual document roots... We also do not setup 3rd party script specific Aliases as it requires them to be added to the server core config files...

Your best bet for handling this is mod_rewrite...

One hint for mod_rewrite and DS:IRMs, make sure you use a leading slash in the substitution part as that will force mod_rewrite to evaluate the path relative to your subdirectory and not that of the primary:
OLD: RewriteRule ^home/([^/]*)(.*)$ home.php?p1=$1 [L]
NEW: RewriteRule ^home/([^/]*)(.*)$ /home.php?p1=$1 [L]

(don't use that verbatim, it is for illustrative purposes only)

--
Terra
sysAdmin
FutureQuest

Gerrit
06-25-2005, 01:49 AM
One hint for mod_rewrite and DS:IRMs, make sure you use a leading slash in the substitution part as that will force mod_rewrite to evaluate the path relative to your subdirectory and not that of the primary:
OLD: RewriteRule ^home/([^/]*)(.*)$ home.php?p1=$1 [L]
NEW: RewriteRule ^home/([^/]*)(.*)$ /home.php?p1=$1 [L]


Do I have to insert the RewriteRule to:
/big/dom/xdomain/www/.htaccess or
/big/dom/xdomain/www/wiki/.htaccess
?

Smile!..
Gerrit

Terra
06-25-2005, 02:07 AM
/big/dom/xdomain/www/wiki/.htaccess

If 'wiki' is indeed your subdomain's directory root...

--
Terra
sysAdmin
FutureQuest

Gerrit
06-25-2005, 02:57 AM
500, 500, 500 ... :dunno:

Joseph
06-25-2005, 03:04 AM
500, 500, 500 ... :dunno:

What are you trying to run in your .htaccess?

Note that Terra said:
(don't use that verbatim, it is for illustrative purposes only)

In reference to the code he posted above...

Gerrit
06-25-2005, 03:09 AM
What are you trying to run in your .htaccess?

I tried several codes from: http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url ... but alway run into 500.