|
URLRewriting
Making URLs prettier using URL rewriting.
URL rewriting is a completely optional feature of Wheels, and all it does is get rid of the index.cfm part of the URL. For example, with URL rewriting off, a URL in your application could look like this: http://localhost/index.cfm/blog/new After turning on URL rewriting, it would look like this: http://localhost/blog/new Combine this with the routing functionality of Wheels, and you get the capablility of creating some really human-friendly (easier to remember, say over the phone, etc.) and search engine friendly URLs (easier to crawl, higher PageRank, etc.). Unfortunately, if you're running your Wheels powered site in a sub folder of another site you will not be able to turn on URL rewriting (at least not without making some custom changes to your rewrite rules), so we recommend running the Wheels site as a stand-alone site whenever possible. If you've met this one requirement and want the shortest and prettiest URLs possible, then just follow the instructions below. Instructions for Apache
That should be it, in fact, on some Apache setups you don't have to do anything at all. Apache will pick up and use the rewrite rules specified in the .htaccess file on server start-up. Instructions for IISUnfortunately, there is no built-in URL rewriting mechanism in IIS, so getting Wheels working with pretty URLs is a little more complicated than with Apache. Here's what you do:
Now restart your web server and enjoy those fancy new URLs. :) |
Sign in to add a comment