What are SES URLs?

In a nutshell, an SES URL has all &, ?, and = characters replaced with /.

For example:

www.example.com/index.cfm?foo=1&bar=2

can be written as:

www.example.com/index.cfm/foo/1/bar/2/

You can also use a "dummy file:"

www.example.com/index.cfm/foo/1/bar/2.cfm

or get more detailed with dummy directories and files:

www.example.com/index.cfm/foo/1/bar/2/the_page/about_us/day/monday.cfm

How do you use sesConverter?

There are two important things to be aware of:
  1. how to execute this script
  2. basehref tag
1) How to execute this script:

This CF script can be CFINCLUDED or called as a custom tag. Here's some code to use for CFINCLUDING:
<!--- ses stuff --->
<cfset SESdummyExtension = ".cfm">
<cfset SESrBaseName = "baseHREF"> 
<cfinclude template="sesConverter.cfm">
Where to you put this code? Well, it depends:

If you are using Fusebox: If you are not using Fusebox, application.cfm will work great.

2) BASEHREF Tag:
SES URLs will not work unless you use the basehref tag. BASEHREF is not a CF tag, it's standard HTML. SES URLs mess up your relative links when this tag is not used.

In the <HEAD> section of your templates, headers, Fusebox Layout files, etc, include this code:
<CFIF IsDefined("variables.baseHref")>
	<cfoutput><base href="#variables.baseHref#"></cfoutput>
</CFIF>
You can change the name of the variable used by modifying SESrBaseName (see above in the code used to cfinclude sesConverter). By default, this variable is set to "baseHREF."

Compatability

sesConverter works for ColdFusion 4.5.1 and above. This should work with Apache, IIS, and other less popular web servers like NetPlanet and even CFMX's built in server.

sesConverter is Framework Independent. This means it will work with Fusebox 8, Mach VII, etc. Using your head and verifying sesConverter is executed before your framework will solve 99% of your problems.

Having Troubles?


CFMX Issues:

If you don't want to use dummy files, you may have troubles using SES URLs with CFMX. The solution is to modify the web.xml file. Mine is located in:
C:/Inetpub/wwwroot/WEB-INF/web.xml
Yours could be somewhere else. If you're using CFMX's built in server, try looking in
C:/ColdFusionMX/wwwroot/WEB-INF/web.xml
.

Add the following servlet mapping:
<servlet-mapping>
      <servlet-name>CfmServlet</servlet-name>
      <url-pattern>*</url-pattern>
</servlet-mapping>
For some reason, CFMX needs this, even though there is already a mapping *.cfm/*

It's important to note that if you're running a real web server (ie not CFMX's test server) you'll have two web.xml files on your machine. I'd add the above directive to both files in case you go back and test something with the integrated web server.

IIS Issues:

Apache Issues:

No current issues with Apache are known.