Rewrite for Wiki Clean URL

Topics: Developer Forum, User Forum
Nov 4, 2009 at 12:11 PM

Hello all,


I am trying to setup Clean URLs for our Wiki which is hosted on an internal Domain


and I simply want it to be rewritten to

My file currently reads as follows


RewriteCond %{HTTP_HOST} ^


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


Any ideas to help a newbie to rewriting URLs?

Nov 4, 2009 at 3:59 PM

The HTTP_HOST does not include the scheme (http, https).  It's the hostname only.  Also you need to escape the . characters.  they are wildcards in regex.  I am guessing you don't want wildcards.  And to only match when https is used as the scheme, use the HTTPS server variable.

Try something like this:

RewriteCond %{HTTPS}            ^on$                               [I]
RewriteCond %{HTTP_HOST}        ^www\.domain\.xx\.com$             [I]
RewriteRule ^/wiki/(.*)$        /Testwiki/index.php?title=$1       [I,L]

Check the IIRF logfile if that doesn't work perfectly.