Problem with IIS7 rewrite

134 views
Skip to first unread message

Philip Kaplan

unread,
Sep 5, 2011, 7:54:15 AM9/5/11
to ColdFusion on Wheels
Hi,

First of all - hi! I'm just getting started with CFWheels, though
I've been coding in CFML since 1998 or so.

Here's the first snag I've hit. As instructed in the docs, I turned
on IIS's URL Rewrite and set enabled=true in web.config.

While something happened, it's not working right. Everything seems to
be getting routed to the "Congratulations!" CFWheels welcome page.

For example, this should say "Hello world" (it works when URL Rewrite
is off):
http://beta.fandalism.com/index.cfm/say/hello

And of course this doesn't work either:
http://beta.fandalism.com/say/hello

In fact, everything gets routed to the same page. See:
http://beta.fandalism.com/index.cfm/thisisjibberish_fsjkfhjk4fejkesf

Ideas?

Thanks,
Philip

Gavin Mclelland

unread,
Sep 5, 2011, 4:22:33 PM9/5/11
to cfwh...@googlegroups.com


Philip, Great to see your checking out CFWheels!

I believe the rewrite rule for IIS by default is a catch all rule. I think the original thought behind this setup was the application would be able to handle all errors within the application.
The down side with this is there is minimal debugging built-in to the framework at this point when dealing with broken URLs (There may be a plug-in for this?)

However, in regards to your issue here, sounds like you may be using Railo+Tomcat with IIS7? Have you created your Tomcat host entry yet?

It can be a PITA when your first starting out, this is the exact reason I made the SDK =)

--
Gavin McLelland, Founder




--
You received this message because you are subscribed to the Google Groups "ColdFusion on Wheels" group.
To post to this group, send email to cfwh...@googlegroups.com.
To unsubscribe from this group, send email to cfwheels+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfwheels?hl=en.


Philip Kaplan

unread,
Sep 5, 2011, 5:02:04 PM9/5/11
to cfwh...@googlegroups.com
> Have you created your Tomcat host entry yet?

Yes. Railo works fine, rewrites work fine for my non-cfwheels sites... 

It seems that the rewrite rule that comes with CFWheels doesn't work. Or CFWheels isn't picking up PATH_INFO.  

Either way, I don't know enough about CFWheels (and don't really have the time) to debug it.  

Really wanted to use Wheels on the project I'm about to start.  May have to wait for the next one...  :(

Philip Kaplan

Gavin Mclelland

unread,
Sep 5, 2011, 5:59:37 PM9/5/11
to cfwh...@googlegroups.com
The rewite rules themselves are ok for most apps out the box; But, yeah, that's exactly what is happening, the PATH_INFO is not being passed through to the application.

I'm sure your web.config has uncommented the XML block containing the rewrite rules, but its worth a check.

I don't use IIS7 enough myself to walk you through this but, from my understanding -- in the past, the major snag has been from Tomcat not being connected to IIS 100% the way it should be.

There is a project called IIS to Tomcat Connector (http://tomcatiis.riaforge.org/) at RIAForge that may be able to solve your server configuration.


--
Gavin McLelland, Founder



Philip Kaplan

unread,
Sep 5, 2011, 8:55:01 PM9/5/11
to cfwh...@googlegroups.com
I did some more testing and indeed it appears to be a problem with either IIS or Railo, not with CFWheels. 

For some reason, on my setup, when any request goes through an IIS rewrite, the PATH_INFO comes out blank.

Possibly the tomcatiis connector would fix this, but I fear it might open up a new can of problems, and I really want to just get started with my project.  

Thanks everyone.

Philip Kaplan

Jonathan Smith

unread,
Sep 26, 2011, 1:02:04 PM9/26/11
to ColdFusion on Wheels
Hi,

Is there any follow up on this problem?

I'm also experiencing problems with IIS7 when rewrite is enabled. My
cfwheels app works properly without rewriting, but with rewriting
enabled, my controller's checkLogin filter does an infinite loop
redirect, as though wheels has no longer knows which action I'm
currently on, or like the "except" attribute is being ignored : (

<cffunction name="init">
<cfset filters(through="checkLogin", except="login,loginProcess")>
</cffunction>

<cffunction name="checkLogin">
<Cfif not StructKeyExists(session,"user")>
<cfset redirectTo(controller="main",action="login")>
</cfif>
</cffunction>

Mohamad El-Husseini

unread,
Sep 26, 2011, 2:00:25 PM9/26/11
to cfwh...@googlegroups.com
I'm not sure if this is relevant, so my apologies if it's not. But I had an issue getting Wheels to run out of the box on Railo with Tomcat and Craig was kind enough to put this together: http://craigkaminsky.me/cfwheels-and-ses-urls

Jonathan Smith

unread,
Sep 26, 2011, 3:23:17 PM9/26/11
to ColdFusion on Wheels
Hi,

Thanks for the link! I'm currently using IIS7's "IIS URL Rewrite
Module 2".

My IIS log shows my url was rewritten properly, for example, /
rewrite.cfm/main/login but, cgi.PATH_INFO comes out blank for me
too, and wheels has no idea what I requested, and uses my default
route.

I think I'm going to try disabling it again via web.config, and try
using the Tomcat re-writer you used.

Previous posts seem to indicate that there is an issue with using IIS
rewrite and Tomcat (unfortunate, since wheels 1.1.5 ships with a nice
web.config that makes it look like its going to be easy!)




On Sep 26, 2:00 pm, Mohamad El-Husseini <husseini....@gmail.com>
wrote:

tpet...@gmail.com

unread,
Sep 27, 2011, 8:44:52 AM9/27/11
to ColdFusion on Wheels
if i'm gathering all this correctly, the issue is that with Railo on
IIS7 and the IIS rewrite module installed, wheels rewriting doesn't
work. is this correct?

Jonathan Smith

unread,
Sep 27, 2011, 3:07:21 PM9/27/11
to ColdFusion on Wheels
Hi,

Correct. It seems that rewriting doesn't work in my case, as my
application (Installed at the Webroot) works very well with rewriting
turned off.

When enabled, I am using the web.config file shipped with wheels, with
enabled="true" of course.

Framework: Wheels 1.1.5
CFML Engine: Railo 3.2.3.000
IIS: 7
IIS rewrite module 2: http://www.iis.net/download/urlrewrite

Edward Chanter

unread,
Jan 29, 2013, 8:40:27 AM1/29/13
to cfwh...@googlegroups.com
I'm having the same issue as described in this thread but I'm using ACF10 and not Railo. IIS does seem to be translating the rewrite correctly and it sees the CGI.query_string. The line from the log is:

2013-01-29 13:34:38 192.168.0.99 GET /rewrite.cfm/ reload=design 80 - 81.149.155.15 Mozilla/5.0+(Windows+NT+6.1)+AppleWebKit/537.17+(KHTML,+like+Gecko)+Chrome/24.0.1312.56+Safari/537.17 302 0 0 562

This was written when I accessed http://my.test.domain?reload=design

But I still get the infinite redirect loop when I I have 
<cfset set(URLRewriting="On")>
In the config, when I change it to:
<cfset set(URLRewriting="Partial")>
Everything works nice except for the nasty /redirect.cfm/ part in the URL :(

Has anyone had any luck getting rewrites working for ACF10 on IIS7?

Edward Chanter

unread,
Jan 29, 2013, 11:54:04 AM1/29/13
to cfwh...@googlegroups.com
We solved the problem by entirely ditching the wheels config and using helicon isapi rewriter. Recommend using that if you're on CF10 and IIS7.5.

sorted :)
Reply all
Reply to author
Forward
0 new messages