iisurl-rewrite-modulecoldbox

Coldbox app runs fine in root dir when starting server, but not in subdir on destination server


I feel like I am missing something very basic.

I have an application, the sample MyPlayground application, which I've been following through the tutorial.

The application works correctly when I start the server from commandbox, all the handlers, etc. and views work fine. Example, hitting this: http://127.0.0.1:63157/ brings up the default view as expected.

Hitting /Main brings up the main/index view, as expected.

On our servers, we run ColdFusion on Windows, with IIS as the webserver. My laptop is configured this way.

Hitting my installed Adobe Coldfusion server through IIS on my local machine (laptop): http://localhost/MyPlayground brings up the default view as expected.

Hitting http://localhost/MyPlayground/Main results in 404 http error from IIS. It indicates that the requested URL is: http://localhost/MyPlayground/Main

IIS is suggesting that the Requested URL was: http://localhost:80/MyPlayground/Main, and the Physical Path was: c:\wwwroot\MyPlayground\Main.

From what I understand, this should just work.

I tried using the web.config and the url rewrite module, and I followed the example rewrites from Ortus documentation.

With the url rewrites active, the same problem occurs, but the error is this instead: http://localhost:80/index.cfm/MyPlayGround/Main and the Physical Path is: C:\wwwroot\index.cfm\MyPlayGround\Main

Any help with this would be greatly appreciated.

Thanks, Allen

Placed the folder of the coldbox application in the wwwroot (c:\wwwroot\MyPlayground).

Browsed http://localhost/Myplayground, and then http://localhost/Myplayground/Main

Expected main.index view, but instead received IIS error.


Solution

  • It turns out that my issue was simply the rewrite rule. There are example rewrite rules on the ortus website, and they work fine as long as you put the web.config with the rules into the directory of the coldbox application and not at the root of the webserver itself.