« Previous Next »

Thread: Redirect rule through ISA Server

Last post 07-03-2009 7:53 PM by MRVirtual. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 05-03-2009, 4:18 PM

    Redirect rule through ISA Server

    Hi IIS.net community!

    I've got a problem using the URL Rewrite Module through an ISA 2006 Web Publishing Rule.

    First I set up a rule in IIS to enforce a hostname for a site with multiple hostheaders (www.example.net, example.net). Regardless of the URL the user enters he shall be redirected to example.net/...

    <rewrite>
    <rules>
    <rule name="Enforce Hostname" stopProcessing="true">
    <match url="(.*)" />
    <conditions>
    <add input="{HTTP_HOST}" negate="true" pattern="^example\.net$" />
    </conditions>
    <action type="Redirect" url="http://example.net/{R:0}" redirectType="Permanent" />
    </rule>
    </rules>
    </rewrite>

     

    This rule works without problems if the client can access the webserver directly. However, if the site is published through ISA server I'm not able to get it working. The relevant information of the rule is as follows:

    [To]
    This rule applies to this published site: example.net
    Computername ...: webserver.domain.local
    Forward the original host header: YES
    Requests appear to come from the original client

    [Public Name]
    example.net
    www.example.net

    If an external client tries to browse the website via http://example.net/site.html everything works fine. However, if the user types http://www.example.net/site.html he gets stuck in a loop redirecting exactly to the site he came from.

    A Netmon trace on the client confirms this behaviour. It receives an HTTP response with a response header
    StatusCode: 301
    Location: http://www.example.net/site.html

    Furthermore the payload of the response contains a link to http://www.example.net/site.html.

    The contents of the payload are correct if link translation in the ISA publishing rule is deactivated. The relevant part in the response header is not affected by this option.

    Can anybody help me with this problem? Did someone manage to get redirect rules with URL rewrite module working through ISA Server?

     

    Many thanks,

    MRVirtual.

  • 05-04-2009, 5:38 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 7:38 PM
    • Redmond, WA
    • Posts 661

    Re: Redirect rule through ISA Server

    I am not familiar with ISA Server, but it looks like somebody (ISA Server?) modifies the Location header in the 301 response by adding www back. That causes an infinite redirection loop.

    You can confirm that URL rewrite sets the redirection location correctly by turning on Failed Request Tracing on IIS server and then checking the trace log file.  

    May be somebody can help with ISA configuration here: http://www.isaserver.org/ 

    http://ruslany.net
  • 07-03-2009, 7:53 PM In reply to

    Re: Redirect rule through ISA Server

    I finally managed to get it working. The problem was - as expected - on the side of ISA Server. As I couldn't find any information about this behavior, I wrote an article about it to help others with the same problem: URL Rewrite through ISA Server ends in a loop

    Regards
    MRVirtual

Page 1 of 1 (3 items)
Microsoft Communities