On most Apache setups, you don't have to do anything at all to get URL rewriting to work. Just use the following
.htaccess file and Apache will pick up and use them automatically on server start-up.
There are some exceptions though...
If you have installed Apache yourself you may need to turn on the rewrite module and/or change the security settings before URL rewriting will work:
- Check that the Apache
rewrite_modulehas been loaded by ensuring there are no pound signs before the line that says
LoadModule rewrite_module modules/mod_rewrite.soin the
- Make sure that Apache has permission to load the rewrite rules from the
.htaccessfile. This is done by setting
Allunder the Directory section corresponding to the website you plan on using Wheels on (still inside the
If you have an older version of Apache and you're trying to run your Wheels site in a sub folder of an existing site you may need to hard code the name of this folder in your rewrite rules.
- Change the last line of the
.htaccessfile to the following:
RewriteRule ^(.*)$ /sub_folder_name_goes_here/rewrite.cfm/$1 [L]. Don't forget to change
sub_folder_name_goes_hereto the actual folder name first of course.
Note that it's often considered better practice to include this URL rewriting configuration at the
<virtualhost> block level, but get it working with a
.htaccess file first.
Updated over 3 years ago