Basic Setup Issues with URL Rewrite in IIS 7

161 views
Skip to first unread message

Chris G

unread,
Feb 12, 2014, 8:18:59 PM2/12/14
to cfwh...@googlegroups.com
I'm setting up a new instance of wheels in hopes I can convince my work to refactor our code base using this framework. I'm having some basic issues setting up.


============ URL Rewrite Issue ===================
I'm on IIS 7 using CFWheels 1.1.8. I've installed the microsoft rewrite module and set(URLRewriting="on"); in settings.cfm. However, once I uncomment the rewrite rule in web.config, no matter what controller/action/route I request (whether it exists or not), i get the home route. Anyone else had this issue? 

To be more clear, all of the following result in the home route being shown...
/config/routes.cfm
<cfscript>
addRoute(name="login", pattern="/login", controller="home", action="login");
addRoute(name="home", pattern="", controller="home", action="home");
</cfscript>

/config/settings.cfm
<cfscript>
set(URLRewriting="on");
</cfscript>

E F

unread,
Feb 13, 2014, 1:42:54 AM2/13/14
to cfwh...@googlegroups.com
Have you tried placing the home route above the login route?
-Erik

Chris Geirman

unread,
Feb 13, 2014, 1:47:22 AM2/13/14
to ColdFusion on Wheels

Yes, that's how it was originally. I switched them hoping that would fix it

--
You received this message because you are subscribed to a topic in the Google Groups "ColdFusion on Wheels" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cfwheels/nmzA2i5ZVoQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cfwheels+u...@googlegroups.com.
To post to this group, send email to cfwh...@googlegroups.com.
Visit this group at http://groups.google.com/group/cfwheels.
For more options, visit https://groups.google.com/groups/opt_out.

Risto

unread,
Feb 13, 2014, 4:26:54 PM2/13/14
to cfwh...@googlegroups.com, ch...@geirman.com
After you switched them did you remember to reload?

Chris Geirman

unread,
Feb 13, 2014, 6:54:04 PM2/13/14
to ColdFusion on Wheels
yes, have reloaded multiple times. 

Keep in mind that the problem goes away if I comment out the rewrite rule in web.config (though rewriting doesn't happen)
Also keep in mind that I get the home route even when I call a URL that should 404


On Thu, Feb 13, 2014 at 1:26 PM, Risto <ck.web...@gmail.com> wrote:
After you switched them did you remember to reload?

--
You received this message because you are subscribed to a topic in the Google Groups "ColdFusion on Wheels" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cfwheels/nmzA2i5ZVoQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cfwheels+u...@googlegroups.com.
To post to this group, send email to cfwh...@googlegroups.com.
Visit this group at http://groups.google.com/group/cfwheels.
For more options, visit https://groups.google.com/groups/opt_out.



--

FrogQuest | Photo Scavenger Hunts 
... adventurous, costume-clad teams scour the city, making spectacles of themselves and others as they frantically compete to capture daring, interactive photo quests on their smartphones. High score wins! (www.frogquest.com)

Brandon

unread,
Feb 13, 2014, 6:59:56 PM2/13/14
to cfwh...@googlegroups.com

Have you uncomment url rewrote in the web.config file?

--
You received this message because you are subscribed to the Google Groups "ColdFusion on Wheels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cfwheels+u...@googlegroups.com.

Chris Geirman

unread,
Feb 13, 2014, 7:01:47 PM2/13/14
to ColdFusion on Wheels
Yes, the problem only materializes with the rewrite uncommented in web.config. With it commented, I get URLs such as /index.cfm/login


--
You received this message because you are subscribed to a topic in the Google Groups "ColdFusion on Wheels" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cfwheels/nmzA2i5ZVoQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cfwheels+u...@googlegroups.com.

To post to this group, send email to cfwh...@googlegroups.com.
Visit this group at http://groups.google.com/group/cfwheels.
For more options, visit https://groups.google.com/groups/opt_out.

Simon Allard

unread,
Feb 13, 2014, 7:10:39 PM2/13/14
to cfwheels@googlegroups com

Is your website in the root folder? Or in a folder in your root folder? If it's the latter, you'll have to modify the web.config file to reflect your web structure.

Simon

Simon Allard

unread,
Feb 13, 2014, 7:16:12 PM2/13/14
to cfwheels@googlegroups com
Here's an example of a web.config file if your webiste is in a folder on your root folder. Just replace myKickAssWebSite by yourKickAssWebSite ;)

<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="ColdFusion on Wheels URL Rewriting" enabled="true">
<match url="^(.*)$" ignoreCase="true" />
<conditions logicalGrouping="MatchAll">
<add input="{SCRIPT_NAME}" negate="true" pattern="^/myKickAssWebSite/(flex2gateway|jrunscripts|cfide|cfformgateway|railo-context|files|images|javascripts|miscellaneous|stylesheets|fonts|plugins/BlueImp|robots.txt|sitemap.xml|rewrite.cfm)($|/.*$)" />
</conditions>
<action type="Rewrite" url="/myKickAssWebSite/rewrite.cfm/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

Chris Geirman

unread,
Feb 13, 2014, 7:22:19 PM2/13/14
to ColdFusion on Wheels
thanks Simon... wheels is in the root though, so that's not the problem. 

jjallen

unread,
Feb 17, 2014, 10:53:08 AM2/17/14
to cfwh...@googlegroups.com, ch...@geirman.com
Have you tried removing the leading slash from your login route? i.e.:

addRoute(name="login", pattern="login", controller="home", action="login");

Chris G

unread,
Feb 19, 2014, 7:19:37 PM2/19/14
to cfwh...@googlegroups.com, ch...@geirman.com
Thanks jjallen,

I have now. Thanks for the suggestion, but it didn't help. I have another website with this working fine, so I took that web.config and used it. There were differences. unfortunately, that didn't fix the problem. I have the exact same route setup on that server too and it works fine, but for some reason I can't get it to work on this new server. 

Simon Allard

unread,
Feb 19, 2014, 9:16:11 PM2/19/14
to cfwheels@googlegroups com

Which cfml engine are you using? Railo, ColdFusion? And version?

Chris Geirman

unread,
Feb 19, 2014, 9:25:20 PM2/19/14
to ColdFusion on Wheels

Adobe 10

Simon Allard

unread,
Feb 19, 2014, 9:40:55 PM2/19/14
to cfwheels@googlegroups com

Chris, is your CF 10 server fully updated? All the latest patches/hot fixes installed? If not check this link: http://blogs.coldfusion.com/post.cfm/coldfusion-10-update-1-10-0-1-released, it may be the cause of your problem.

Simon

Chris Geirman

unread,
Feb 19, 2014, 10:32:45 PM2/19/14
to ColdFusion on Wheels

Thank you... I'll check this out tomorrow

Reply all
Reply to author
Forward
0 new messages