Apache URL Rewriting Instructions for Confluence Wiki Running on Windows Server

Here are some steps to configure Apache URL rewriting because I was migrating from dokuwiki to Confluence wiki.

1) Download Url Rewrite Filter – http://www.tuckey.org/urlrewrite/#download

2) Download the zip and extract it into your Confluence directory — E:\clients\Confluence\confluence-3.2.1_01-std\confluence\WEB-INF (in the WEB-INF directory, you will see the urlrewrite.xml file).

3) Copy the web.xml to your WEB-INF directory and add the following to your WEB-INF\web.xml (add it near the top above your servlet mappings)

<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
</filter>

<filter-mapping>

<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

4) Add your own URL rewrite rules to the WEB-INF\urlrewrite.xml that was created.

For my purposes, I was migrating from dokuwiki to Confluence. My old doc site running on dokuwiki was docs.mydomain.com but I wanted to move it to archives.mydomain.com and use the docs.mydomain.com URL for my new Confluence site.

For special characters like “.” or “:” or “?” I had to use a back slash (“\”) in front of the special character — see below for an example.

Here is my urlrewrite.xml file

<?xml version=”1.0″ encoding=”utf-8″?>

<!DOCTYPE urlrewrite PUBLIC “-//tuckey.org//DTD UrlRewrite 2.6//EN” “http://tuckey.org/res/dtds/urlrewrite2.6.dtd“>

<urlrewrite>
<rule>

<from>^/ecf/5\.1/doku\.php\?id\=getting\_started$</from>
<to type=”redirect”>/display/ecf51releasehistory/Home</to>

</rule>

<rule>
<from>^/ecf/5\.1/doku\.php\?id\=configuration\_and\_deployment\:installation\_guide\:prerequisites$</from>
<to type=”redirect”>/display/ecf51installanddeploy/System\+Requirements</to>
</rule>

<rule>
<from>^/ecf/5\.1/doku\.php\?id\=configuration\_and\_deployment\:installation\_guide\:mediachase\_wizard\_installation$</from>
<to type=”redirect”>/display/ecf51installanddeploy/SDK\+Installation\+Using\+Installer</to>
</rule>

<rule>
<from>^/ecf/5\.1/doku\.php\?id\=configuration\_and\_deployment\:installation\_guide\:mediachase\_wizard\_installation#verificationperforming\_simple\_end\_user\_tasks$</from>
<to type=”redirect”>/display/ecf51releasehistory/Home</to>
</rule>

<rule>
<from>^/ecf/5\.1</from>
<to type=”redirect”>/dashboard.action</to>
</rule>

<!– For image references in CSS files –>
<rule>
<from>^/s/(.*)/_/download/images/([^\?]*).*</from>
<run method=”addPublicCachingHeaders” />
<to type=”forward”>/images/$2</to>
</rule>

<rule>
<from>^/s/(.*)/_/([^\?]*).*</from>
<run method=”addPublicCachingHeaders” />
<to type=”forward”>/$2</to>
</rule>

</urlrewrite>

5) Restart the Apache Tomcat Confluence service.

2 Comments (+add yours?)

  1. Wrgddimv
    Sep 07, 2011 @ 17:13:26

    The manager pedo art
    =-P

  2. Zelocawn
    Sep 07, 2011 @ 19:12:35

    I’m interested in pedo nude
    hlnns

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Twitter Feed

Follow

Get every new post delivered to your Inbox.