You need to specify a rewrite handler for everything in the /news/ path.  
Assuming /news.cfm handles all of your requests for that path, your rule would 
look something like this:

                                <rule name=“News Handler" stopProcessing="true">
                                        <match url="^news/(.*)" 
ignoreCase="false" /><action type="Rewrite" url="/news.cfm?{R:1}" 
appendQueryString="false" />
                                </rule>

If you add this rule above the “AddCFM” rule, it will stop processing 
subsequent rules and should give you the behavior you are looking for.

HTH,
Jon


On Dec 10, 2014, at 9:42 AM, Robert Harrison <rharri...@aimg.com> wrote:

> 
> I'm no expert on this, and struggle with IIS config, so hopefully someone on
> the list can help.  I'm trying to use URLs like
> mysite.com/news/2014/the-article.  
> 
> Below is a url rewrite that rewrites a request like mysite.com/news/ to
> myside/news.cfm.  That part works.  But, if you add another directory like
> mysite.com/news/2014 it tries to rewrite to mysite.com/news/2014.cfm and
> that does no good.  Does anyone know if  there is a way to get it this to
> rewrite the .cfm only on the first url var after the first /? 
> 
> Thanks
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <configuration>
> <system.webServer>
> <rewrite>
> <rules>
> <rule name="AddCFM" enabled="true">
> <match url=".*" negate="false" />
> <conditions>
> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
> <add input="{URL}" pattern="(.*)\.(.*)" negate="true" />
> </conditions>
> <action type="Rewrite" url="{R:0}.cfm" />
> </rule>
> </rules>
> </rewrite>
> </system.webServer>
> </configuration>
> 
> 
> Robert Harrison
> Full Stack Developer
> AIMG
> rharri...@aimg.com
> Main Office: 704-321-1234 ext.121
> Direct Line: 516-302-4345
> www.aimg.com
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359787
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to