Question

We need to estimate a portal based on ColdFusion technology. We have no information about the hosting environment (could be Windows or Linux).

One of the requested features is clean URLs. Does anyone know if this can be achieved with a pure ColdFusion solution or is this always web server related? I know there are neat extensions for IIS7 for enabling clean URLs but I'm afraid we can't depend on those.

Was it helpful?

Solution

You can use ColdFusion's Application.cfc's onMissingTemplate() method to achieve this effect. If you want to have extensions other than .cfm you'll need to do some web server configuration to make ColdFusion serve other extensions and directory paths (e.g. /path/to/something/) needs to be configured to have a standard default document (e.g. index.cfm). Ben Nadel has a blog post that covers this idea extensively - be sure to check the comments as well.

That noted, both IIS 7 and Apache have URL rewriting modules (assuming these are the web servers in Windows and Linux, respectively). So this is a situation where if you know your URL patterns the module is an easier route. However, if the patterns are dynamic ColdFusion alone may be a better, if more complex path, where you'll need to configure the web server as I've explained above.

OTHER TIPS

Another option.

Check out "blogCFC" from Ray Camden (www.coldfusionjedi.com) ... it uses a pure CF approach to SES urls without the missing template approach.

The URLs look like /blabh.com/index.cfm/something/somethingelse

The .cfm in the middle is not pro-forma - but it works well and his blog software get's picked up on indexing engines pretty well. I use it.

Still another option is using the 404 handler on the web server.. this does require some configuration - but only in one spot and you don't have to write rules for a filter like mod_rewrite... but again, it may be beyond what you can accomplish if you have a restrictive hosting contract. Here's a post on the topic.

http://www.coldfusionmuse.com/index.cfm?mode=entry&entry=8F4658E4-0763-5FB7-67D23B839AB74005

-Mark

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top