Removing index.cfm From Mura CMS URLs on Windows/IIS7

If you have an installation of Mura CMS on Windows running IIS7+ and you're looking to remove "index.cfm" from the URL for search engine optimization (SEO) or any other reason, then here's a pretty simple and painless method to do just that.

First, IIS7 does not have their URL Rewrite Module installed by default. So you'll need to download and install URL Rewrite Module 2.0 for your server (x86 / x64).

After that's done, your next decision is to choose whether or not you wish to have the SiteID display in the URL. Some users prefer to have that, and some don't depending on their particular usage of Mura.

Option 1: Allow For Missing SiteID AND index.cfm From The URL

Create a "web.config" file with the following code and place it at the root of your Mura installation:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Mura CMS Rewrite Option 1" enabled="true">
                    <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>
        <defaultDocument>
            <files>
                <remove value="index.cfm" />
                <add value="index.cfm" />
            </files>
        </defaultDocument>
    </system.webServer>
</configuration>

Then, update your settings.ini.cfm file with the following settings and from the Admin > Reload Application:

siteidinurls=0
indexfileinurls=0

Option 2: Allow For Missing index.cfm From The URL, But Keep SiteID

Create a "web.config" file with the following code and place it at the root of your Mura installation:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Mura CMS Rewrite Option 2" enabled="true">
                    <match url="^([a-zA-Z0-9-]{1,})/([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="/{R:1}/index.cfm/{R:2}" />
                </rule>
            </rules>
        </rewrite>
        <defaultDocument>
            <files>
                <remove value="index.cfm" />
                <add value="index.cfm" />
            </files>
        </defaultDocument>
    </system.webServer>
</configuration>

Then, update your settings.ini.cfm file with the following settings and from the Admin > Reload Application:

siteidinurls=1
indexfileinurls=0

Your site should now be able to handle URLs that are missing index.cfm.

Cheers!

Related Blog Entries

Comments
Steve: Thanks for this information. It just occurred to me that our development site is using II6. Is there an alternate program to use in this case.

...Wes
# Posted By Wes Anderson | 9/15/11 9:54 AM
Okay, I answered my own question. I downloaded the Helicon app and installed it. I've set everything up per your previous blog and now the index.cfm is gone. Problem is now when I click on a link I'm getting "page cannot be found".

Any advice on how to rectify this?

...Wes
# Posted By Wes Anderson | 9/15/11 10:04 AM
Steve,

I'm trying to create a URL Rewrite based on option 2, but I have MURA installed under a subdirectory named "mura". I would like to set things up so a user can use the URL "http://domain_name/siteID/";, even though the actual rewrite path should be "http://domain_name/mura/siteID/index.cfm/site_subd...;. Is there a way to do this, or will it not work if MURA is installed in a subdirectory? If you could provide me with any help on this, I would appreciate it. Thanks!
# Posted By Jon Saltern | 11/3/11 12:42 PM
Thanks, Steve. SO easy...
# Posted By Catherine Mortali | 12/9/11 6:22 PM
Thanks Steve! This worked out great for me!
# Posted By Lynn | 9/4/13 11:41 AM
This might help other people in future.

If you are migrating a site and need to add lots of redirects to handle new seo ... Add a rewrite map before the mura specific rule:
<rule name="Redirect rule1 for Redirects">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{Redirects:{REQUEST_URI}}" pattern="(.+)" />
</conditions>
<action type="Redirect" url="{C:1}" appendQueryString="false" />
</rule>

This all worked - however I ran into issues with 404's (I needed to use the siteid 404's to track in omniture, and needed to be language specific) so I set the mura 404's up, but then I ran into another issue with 404's outside of any locale (siteid) and on cf10 had issues with cfheader sending the wrong response for a 404 (200)! This was by design I understand, but I needed to track the 404's to document people fatfingering vanity urls etc.

So what I did was add this rule:

<rule name="CatchAll" enabled="true" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
         <add input="{REQUEST_URI}" pattern="^/au/.*" negate="true" />

         <add input="{REQUEST_URI}" pattern="^/cn/.*" negate="true" />          <add input="{REQUEST_URI}" pattern="^/de/.*" negate="true" />
         <add input="{REQUEST_URI}" pattern="^/en/.*" negate="true" />
         <add input="{REQUEST_URI}" pattern="^/es/.*" negate="true" />
         <add input="{REQUEST_URI}" pattern="^/jp/.*" negate="true" />
         <add input="{REQUEST_URI}" pattern="^/kr/.*" negate="true" />
         <add input="{REQUEST_URI}" pattern="^/nz/.*" negate="true" />
         <add input="{REQUEST_URI}" pattern="^/tw/.*" negate="true" />
         <add input="{REQUEST_URI}" pattern="^/uk/.*" negate="true" />

</conditions>
<action type="Redirect" url="/404.cfm?page={REQUEST_URI}" />
</rule>

In my 404.cfm I added
<cfheader statuscode="404" statustext="Not Found">
then created my 404 layout and tracking codes OUTSIDE of mura framework.

Why would you do this? You don't want someone maliciously adding 100's of links to non-existent pages, or rather pages that exist but return duff content (http response 200) because Google/search engines will penalize you!



# Posted By Jon Hayes | 2/26/15 2:49 PM
@Jon,

Thanks for the info ... we've made several updates to the actual web.config that's included with Mura as well.

Also, you could probably tighten up all of those <add input ...> methods with something like:

<add input="{REQUEST_URI}" pattern="^/(au|cn|de|en|es|jp|kr|nz|tw|uk)/.*" negate="true" />

Cheers,
Steve
# Posted By Steve Withington | 2/26/15 2:54 PM
Useful information thanks for sharing with us for the informative article and get the best chance for student making an assignment
# Posted By Assignment Writing Companies | 2/28/18 2:04 AM
This model is made of http://www.bestukwatches.co.uk 18k white gold bezel and Rolex jaw steel. Rolex steel is http://www.rolexsreplicas.org.uk Rolex's 904L stainless steel. It has now been renamed as http://www.toprolexreplicauk.co.uk jaw steel. The dial is very cool and gray, very http://www.perfectreplicawatch.me.uk beautiful and banned.
# Posted By vsvs | 5/14/18 9:26 PM
Impressive article I really like it.This is a great thing and getting a lot of help for us .So many student help reading this post and easily making an assignment. https://www.pikview.com/
# Posted By pikview | 10/18/18 2:58 AM
# Posted By nik | 11/2/18 2:38 AM
You have to done wonderful job by providing here coding for removing index.cfm From Mura CMS URLs on Windows/IIS7 which are helpful for IT people who take CV writing services from CV Folks.


Best Regards,
https://www.cvfolks.co.uk/cv-builder/
# Posted By Lauren Desouza | 11/2/18 2:41 AM
kids hair extensions unice hair 360 frontal wig https://www.wighair.co.uk tape in hair extensions uk salons best salon for hair extensions https://www.leez-extensions.co.uk superdrug hair extensions short weave hairstyles pictures http://www.hairflair.org.uk wholesale program for hair integrated hair topper http://www.humanhair-extensions.co.uk
# Posted By vc | 11/4/18 8:48 PM

© 2018, Stephen J. Withington, Jr.  |  BlogCFC was created by Raymond Camden – Version 5.9.004

Creative Commons License  |  This work is licensed under a Creative Commons Attribution 3.0 Unported License.  |  Hosted by Hostek.com