Pretty URL's for mediawiki

software development

#1

Another noob rewrite question, sorry in advance.

I’m new to DH and working with a DH subdomain before I switch my site over. The main hurdle remaining is getting pretty URL’s for my mediawiki installation. I want to keep the index.php so it looks like this:

wiki/index.php/Main_Page
not
wiki/index.php?title=Main_Page

Here are my current rewrite rules, in .htaccess in my web root directory:

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

The wiki is installed under wiki/. These rules don’t seem to be having any effect at all – I just get a page not found error when my wiki is set for pretty URL’s. Is there something I need to do to activate the .htaccess file or is it read automatically?

I’m on pretzel, in case that matters. Any help appreciated.

Michelle


#2

Hi,
The htaccess file is read automatically by Apache you simply need to put it into your ‘root’ where MW is installed. As for the domains issue I am not a rewrite guru but I suspect the issue may be because of the subdomain.

Can you clarity the URL you are using i.e subname.dreamhost.com?

or has your domain propogated?


#3

Thanks! I haven’t assigned my domain yet. My temp domain is:

http://www.sg1solutions.dreamhosters.com/

With the wiki installed in /wiki. It works fine with ugly URL’s but not with the rewrite/pretty ones.

The thing is, once I propagate the domain, I want the url of the wiki to be:

http://wiki.mydomain.com/index.php/Main_Page

So I need to get the subdomain thing working anyway. I tried this once before when I attempted to switch hosting and it didn’t work then either, so I want to be sure this time before I throw the switch.

I’m sure someone on DH has gotten this to work. I hope :slight_smile:

Michelle


#4

Okay, I figured it out. The wiki has to be stored in a directory named other than wiki, then directed to wiki by the rewrite rules. Then the wiki’s LocalSettings.php have to be set accordingly… pretty much like what the wikimedia article says:

http://meta.wikimedia.org/wiki/Rewrite_Rules#Using_a_rewrite_rule_in_a_.htaccess_file

But what I didn’t realize is it won’t work if the redirect is from and to the same subdirectory.