Apache redirect-fu

I’ve been beating my head against Apache’s RedirectMatch syntax for the past few days.

I have a Media Wiki installation that was configured to have URLs of the form h**p://site.com/index.php?Article_Name

Following the advice on MetaWiki, I managed to make the URLs be of the form, h**p://site.com/wiki/Article_Name

But now I’m finding it completely impossible to set it up so that anyone visiting the old style URLs get handled properly.

I had hoped that I could use:

RedirectMatch /index.php?([^?]+) http://site.com/wiki/$1

This, however, appears to do nothing.

I had originally forgotten to backslash the question mark:

RedirectMatch /index.php?([^?]+) http://site.com/wiki/$1

This version worked, sort of, in that it redirected all old-style requests to h**p://site.com/wiki/p?oldname, which isn’t really what I want – but it implies that the idea is mostly correct.

There’s probably something really obvious that I’m missing, but my google-fu doesn’t seem up to it at the moment either.

Anyone have any clues? blog@tmtm.com…

One thought on “Apache redirect-fu

  1. I am not an expert, but try adding [R] ([R]) on the end. For some reason my version of apache will not redirect without this (Even though it should)

Leave a Reply

Your email address will not be published. Required fields are marked *