I just setup my first Mura CMS install and I'm using Apache mod_rewrite (IIS has parallel tools you can buy) to do a little URL rewriting such that my URLs are all extremely clean and SES (search engine safe).
For example, I'm rewriting a URL like this:
http://www.domain.com/my-page/
...to something like this (without public users knowing/seeing it):
http://www.domain.com/siteid/index.cfm/my-page/
There are already two topics in this forum that cover most of this, but I ran into one additional quirk and also thought I'd share my URL rewrite rules.
I used this post from Matt to remove the siteID from the URLs.
I used this post from Tony to remove the index.cfm from the URLs.
Here are the URL rewrite rules/conditions I'm using:
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]All seemed to be working great, until I tried to use the site search feature. The action for the search form was "index.cfm" which would work if you're on the home page, but otherwise you'll end up with a 404 at a URL something like this:
http://www.domain.com/my-page/index.cfm?keywords=searchtext&display=search&newSearch=true&noCache=1
I took a peak at the code and noticed that the form action is being pulled from the configBean's indexFile attribute, which is easily modified in your config/settings.ini.cfm file...
Just change this line:
indexfile=index.cfm
...to this:
indexfile=/
Best,
Jamie