• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

IIS outbound url rewrite

New Here ,
Nov 23, 2017 Nov 23, 2017

Copy link to clipboard

Copied

is it possible to set up Outbound url rewrite rules using Coldfusion and IIS?

If if anyone has this working, please point me to an example,

i have no no problem with IIS and .net or html pages but when I try .cfm either the server hangs or the outbound rules only work with the target page.

no issues with inbound rewrite

regards

Richard

Views

1.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Nov 24, 2017 Nov 24, 2017

Copy link to clipboard

Copied

What are you trying to do with the rules?

What rules are you using?

Without more information, its hard to say what the issue is.

I have had no issues with outbound rewrite rules so its likely an issue with your rule or IIS setup.

What version of IIS and CF?

Have you looked at any logs or tried Failed Request Tracing?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 27, 2017 Nov 27, 2017

Copy link to clipboard

Copied

I am using CF11 and IIS 7. Outbound rule created by User Friendly template in IIS is:

               <rule name="OutboundRewriteUserFriendlyURL1" preCondition="ResponseIsHtml1" enabled="false">

                    <match filterByTags="A, Form, Img" pattern="^(.*/)catalog/catalog_item_page\.cfm\?style_code=([^=&]+)&(?:amp;)?style_name=([^=&]+)&(?:amp;)?category=([^=&]+)$" />

                    <action type="Rewrite" value="{R:1}{R:2}/{R:3}/{R:4}/" />

                </rule>

We are replacing our website with a new one and wish to set up friendly urls and also reroute links from the old site to the new.

I will have a look at trace logs

Thanks for your help

Regards

Richard

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 30, 2017 Nov 30, 2017

Copy link to clipboard

Copied

I’ve done this before but its more of a hybrid with IIS rules and catching them as variables through application.cfc. It also uses extensionless urls. Can also use CF and error catching to act as a programatic redirect hub for all URL paths. What works for you really depends on use cases and the flexibility you need down the road.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 13, 2017 Dec 13, 2017

Copy link to clipboard

Copied

LATEST

Still no progress on this. I have set up Failed Trace logging and get the following which points somewhere but I don't know where

<EventData>

  <Data Name="ContextId">{00000000-0000-0000-6403-0080020000E9}</Data>

  <Data Name="ModuleName">RewriteModule</Data>

  <Data Name="Notification">536870912</Data>

  <Data Name="HttpStatus">500</Data>

  <Data Name="HttpReason">URL Rewrite Module Error.</Data>

  <Data Name="HttpSubStatus">52</Data>

  <Data Name="ErrorCode">2147942413</Data>

  <Data Name="ConfigExceptionInfo"></Data>

</EventData>

<RenderingInfo Culture="en-GB">

  <Opcode>MODULE_SET_RESPONSE_ERROR_STATUS</Opcode>

  <Keywords>

   <Keyword>RequestNotifications</Keyword>

  </Keywords>

  <freb:Description Data="Notification">SEND_RESPONSE</freb:Description>

  <freb:Description Data="ErrorCode">The data is invalid.

(0x8007000d)</freb:Description>

</RenderingInfo>

<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">

  <EventGuid>{002E91E3-E7AE-44AB-8E07-99230FFA6ADE}</EventGuid>

</ExtendedTracingInfo>

</Event>

Regards

Richard

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 24, 2017 Nov 24, 2017

Copy link to clipboard

Copied

I don't know if you can use IIS's rewrite mechanism for this. But you can use CF to do this yourself, using the onRequest method in Application.cfc. You can use this to rewrite practically anything that is part of the response. This can impose significant overhead if you're not careful, though.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 24, 2017 Nov 24, 2017

Copy link to clipboard

Copied

We've needed to do this in the past, but we didn't do it using IIS Rewrites. (NOTE: We use IISWebSpeed to perform many post-CF optimizations.)

We use getPageContext().getCFOutput().getBuffer() to capture the output buffer.  To change URLs, correct some third-party HTML and relocate desired CSS/JS to the footer (based on inline attributes), We use jSoup to remove/append/modify the HTML before delivering the HTML content to IIS.  (We've had to increase the buffer size and this method doesn't work if some content has already been flushed.)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 29, 2017 Nov 29, 2017

Copy link to clipboard

Copied

I have the outbound rule partially working. It rewrites the target but never finishes loading. This then has knock on effects elsewhere. I have a CFC which works when rule disabled but reports err_incomplete_chunked_encoding when I enable it. Does this point to a solution for anyone?

regards

richard

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation