SES questions are probably one of the most common ones asked here, and I apologize if this has been answered a bunch of times before. I’ve checked the docs and I’ve looked here and I just don’t see what I am doing wrong.
I’m running CF9 with Coldbox 3.1 on a Windows server with IIS 7.
In the routes.cfm file, I have setUniqueURLS set to true, and setAutoReload set to true (I’ve tried with both at default settings also). I also created a default route for mapping url calls to “/” to a specific handler/action, and that seems to work just fine.
So I think I have done everything correctly. But if I go to anything like this: www.mysite.com/handler/action I get a message saying that the page cannot be found. If I try going to the page like this:
Which ISAPI Rewrite have you installed, the ones you have posted look very much like .htaccess rewrite rules. Which means you would need the Helicon ISAPI rewrite module, or Helicon Ape.
I believe I have the standard Microsoft ISAPI rewrite installed… I’m not sure how to check that. If that’s the case, do I need to get the rewrite rules from a different source?
But what is happening now is that any url I go to using the syntax above instead maps to the default event specified in the Coldbox.cfc config file. And I definitely have handlers/actions set up to match the URLs that I am testing.
I can’t access some of my CB code right now, but did you update routes.cfm to remove “index.cfm” from the base path (can’t remember the actual variable name)?
No, that url structure doesn’t work either. The page takes quite a while to resolve, and when it does it just goes to the default event.
I did not make any changes to routes.cfm, as my understanding is that the removal of “index.cfm” from the base path is handled by the url rewrite module, but I could definitely be wrong about that.
I’m assuming you don’t mean the Mura-specific rule, just the “Insert index.cfm” rule below it. Yes, I have that rule in place already, as it was part of the web.config file supplied with Coldbox.
It’s in the install\SES Rewrite Rules directory of the 3.1 package. It may only be in the full-download package though, not the “economy size” package, lol.
I think I have success! I looked at some of the sample apps in the Coldbox install package and I saw this route:
addRoute(pattern=":handler/:action?");
I did not have this in my code and once I put this in, the pages started resolving correctly.
For anyone’s future reference, here’s what worked for me:
With Windows/IIS 7 server I used the Microsoft URL Rewrite module.
I put the web.config file provided in the Coldbox install package into the root of the site. Once that file is there, the URL rewrite module “sees” it automatically.
I then made sure that the route above was in my routes.cfm file.