Contact Us

Let us know to help you out quickly!

 Pritesh     Feb,08 2017

Setup MURA CMS Under Subfolder on Railo Ubuntu

Recently I was working with site migration from windows to ubuntu server. Normally everything goes smoother except case sensitivity of file name. While working with window we never take care about file name case since it doesn't matter in window. Although we use standard for file naming but mistake will not reveal. After renaming file name accordingly everything work fine except one project. In this project I was running ColdBox framework in root folder for all kind of administrative work or business management and there was a folder /website which contain front public website. Front website running under MURA cms. When we move to RAILO and UBUNTU home page load correctly but rest of pages showing 404 error. 

Since we were not using index.cfm in url required to make changes in .htaccess file to make sure URL correctly rewritten. Below is .htaccess code

Options +FollowSymLinksRewriteEngine On DirectoryIndex index.cfmRewriteRule ^$ /website/ [R]RewriteCond  %{DOCUMENT_ROOT}%{REQUEST_URI}  !-dRewriteRule ^website/([a-zA-Z0-9/-\s]+)$ /website/index.cfm/$1 [PT]

Added "website/" in last rule to make sure rule only apply for request starting with website and rest of part will be consider as URL parameter for MURA to handle it. Anyhow there were two index.cfm added in URL after rewrite rule executed.
Let's say URL I am trying to access is

http://example.com/website/privacy/

is received as below in MURA

http://example.com/website/index.cfm/privacy/index.cfm

Notice two index.cfm inside URL and this was causing 404 error since Apache/Tomcat looking for index.cfm under privacy folder which doesn't actually exists. I was not able to find what actually adding index.cfm at end. I am sure that RewriteRule was correct and creating correct URL. After googling it turn out that TOMCAT (yes TOMCAT) was adding index.cfm at the end. Since by default Tomcat allowing SES mapping from root of the web application only you required to add new <url-pattern> in web.xml file.

RESOLUTION:

Search for comment Basic SES Mapping in web.xml file and add <url-pattern>/website/index.cfm/*</url-pattern>. Now it should allow you to SES mapping from website folder as well.

Hope this help.