Removing SiteID and index.cfm from Mura CMS

In this article we will be going through the way to change your Mura CMS URLS from:

http://www.yourdomain.com/default/index.cfm/page/sub-page/

INTO

http://www.yourdomain.com/page/sub-page/

To remove the siteID directory in the URL:

  1. In the local contentRenderer.cfc ([www/[siteID]/includes/contentRenderer.cfc) uncomment the function named getURLStem() or paste the below code at the base of the file:

    <!--- This is to used when removing both siteID and index.cfm from urls--->
    <cffunction name="getURLStem" access="public" output="false" returntype="string">
    <cfargument name="siteID">
    <cfargument name="filename">
    <cfif arguments.filename neq ''>
    <cfreturn "/" & arguments.filename & "/"/>
    <cfelse>
    <cfreturn "/" />
    </cfif>
  2. Edit www/index.cfm and replace:
    <cfinclude template="tasks/content/redirect.cfm">
    with
    <cfinclude template="tasks/content/contentServerRoot.cfm">

The .htaccess file / code to remove the index.cfm:

RewriteEngine On

# If it's a real path, just serve it
RewriteCond  %{REQUEST_FILENAME}  -f  [OR]
RewriteCond  %{REQUEST_FILENAME}  -d
RewriteRule  .  -  [L]

# Redirect if no trailing slash
RewriteRule  ^(.+[^/])$  $1/  [R=301,L]

# Rewrite Mura CMS URL paths
RewriteRule  ^(.*)$  /index.cfm%{REQUEST_URI}  [L]

The old /[siteID]/ urls will still work after making these changes.

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

Migration: To and from Linux/Windows Servers

Here are some key points and issues when migrating from or to Linux/Windows servers.MsSQL...

Useful ColdFusion Resources & Websites

ColdFusion has a huge community and support so we thought we would share some of the great...

Installing Mura CMS (Version 5)

Installing Mura CMS 5 is a simple process and even simpler when on a local machine. The...

Fixing HTTPS (I/O Exception: java.security.NoSuchAlgorithmException) errors

When working with CFHTTP and calling URLs that are secured with SSL (HTTPS) you may receive the...

Enable ColdFusion errors instead of IIS errors - Windows Only

To enable ColdFusion errors per domain you need to add the following lines to your web.config...