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:
<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:
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:
<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:
indexfileinurls=0
Your site should now be able to handle URLs that are missing index.cfm.
Cheers!
...Wes
Any advice on how to rectify this?
...Wes
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!
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!
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
Best Regards,
https://www.cvfolks.co.uk/cv-builder/
http://www.jaipurescorts.net.in/
http://www.escortsinjaipur.com/
https://www.escortsindwarka.com/jaipur.html
https://www.jaipurescorts.org/
http://www.aoneassignment.com/
https://www.vidwonders.com/animation-videos-on-whi...
https://www.samishleather.com/product/riverdale-tv...
http://www.aoneassignment.com/write-college-essay-...
https://www.samishleather.com/category/shearling-l...
https://www.vidwonders.com/
http://www.aoneassignment.com/
https://www.adelhiescort.com/
http://www.nishamumbaiescorts.in/ghaziabad-escorts...
http://www.sanakhan.in/
http://www.richaescorts.com/
http://www.ghaziabadcallgirls.co.in/
http://www.riyaghaziabadescorts.com/
http://www.escortsghaziabad.org/
https://www.thebangaloreescorts.in/hotel/oberoi.ht...
https://www.thebangaloreescorts.in/hotel/taj.html
https://www.thebangaloreescorts.in/hotel/the-ritz-...
https://www.nituparnadas.com/
https://www.sonakshiurmil.com/
https://goaescortssapna.com/
http://www.hyderabadescortsservicegirl.com/best-ca...
http://www.hyderabadescortsservicegirl.com/escorts...
http://www.hyderabadescortsservicegirl.com/escorts...
http://www.escortsgoafemales.com/call-girls-goa.ht...
http://www.escortsgoafemales.com/escorts-call-girl...
http://www.escortsgoafemales.com/escorts-call-girl...
http://www.escortsservicehyderabad.com/hyderabad-c...
https://www.mumbaiescortsrani.com/
https://www.sanjanakaur.com/andheri.html" target="_blank">https://www.sanjanakaur.com/andheri.html
https://www.sanjanakaur.com/bandra.html
https://www.sanjanakaur.com/juhu.html" target="_blank">https://www.sanjanakaur.com/juhu.html