Mura CMS URL rewriting for Windows IIS7

It has been sometime since my post on friendly URL's in Mura CMS. A lot has changed, it's now even easier to have friendly URL's. Best of all it only takes a few seconds.

Getting rid of the siteID & index.cfm

First open the config/settings.ini.cfm file. We are interested in two settings, siteidinurls and indexfileinurls. Change both of these to 0.

view plain print about
1siteidinurls=0
2indexfileinurls=0

Note: If you get rid of siteid and plan to run more than one site on the same instance of Mura, then all you have to do is change your bindings in IIS 7 to match what you have setup for each site in Mura. Doing this means you can have each site on their own domain running from one instance of Mura, cool or what?

Now, logon to your Windows Server 2008 and install the rewriting extension found here. Install either the 32bit or 64bit depending on your OS.

Once installed, open up your Mura site in the IIS 7 Manager. Then double click on the new URL "rewrite" icon. You will now see on the right hand side under actions, an option called "Select Import Rules". Click this and enter the following in the rewrite rules box and click apply...

view plain print about
1RewriteEngine On
2RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
3RewriteRule ^([a-zA-Z0-9/-]+)$ /index.cfm%{REQUEST_URI} [PT]

Lastly restart the website and then Mura. Thats it.

Jan23

Comments 5

  1. Josh D's Gravatar # Posted By Josh D
    25/01/11 21:51

    Thank for this Glyn. needed the rule, perfect.

  1. David Wilson's Gravatar # Posted By David Wilson
    10/02/11 16:39

    I tried to do this on my local machine and all I get on Firefox is the following error:

    The page isn't redirecting properly

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    Do you have any reason why that would be the case? My base url is http://localhost:93. The contents of the web.config file are below.


    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <rule name="Imported Rule 1">
    <match url="^([a-zA-Z0-9/-]+)$" ignoreCase="false" />
    <conditions logicalGrouping="MatchAll">
    <add input="{DOCUMENT_ROOT}{URL}" matchType="IsDirectory" ignoreCase="false" negate="true" />
    </conditions>
    <action type="Rewrite" url="/index.cfm{URL}" />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>

  1. JN's Gravatar # Posted By JN
    03/03/11 05:31

    Wow, great post! I have a client that needs this done, thanks for the tip.

  1. Brian's Gravatar # Posted By Brian
    09/06/11 16:52

    Greetings, thanks for the write-up... I'm able to remove the site ID and index.cfm and the home page loads fine. URLs are also showing the removal of the siteID and index.cfm. However, the links are returning a broken link error. Missing something very obvious I know... Any help appreciated...thanks!

  1. Glyn Jackson's Gravatar # Posted By Glyn Jackson
    15/06/11 13:13

    Sorry only just seen your post. Sounds like an issue with contentRenderer. make sure you have edited the config siteidinurls=0 indexfileinurls=0 so the content renderer knows how to correctly render the URL's also make sure you have the most updated version of Mura.