+ Post New Thread
Results 1 to 2 of 2
Windows Server 2008 R2 Thread, IIS 7.5 URL Rewrite Problem in Technical; Hi, I wish to setup step 4 in this URL 10 URL Rewriting Tips and Tricks : Ruslan's Blog : ...
  1. #1

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,229
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462

    IIS 7.5 URL Rewrite Problem

    Hi,

    I wish to setup step 4 in this URL 10 URL Rewriting Tips and Tricks : Ruslan's Blog : The Official Microsoft IIS Site

    I have got the following code in my web.conf file but when i try to get to the site i get error 500. When i remove the code this site works as usual.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <rule name="Redirect to HTTPS" stopProcessing="true">
      <match url="(.*)" />
      <conditions>
        <add input="{HTTPS}" pattern="^OFF$" />
      </conditions>
      <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
    </rule>
    </configuration>
    Any thoughts please?

    Thanks

    EDIT: I have also tried this code with no luck.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <rewrite>
                <rules>
    <rule name="Redirect to HTTPS" stopProcessing="true">
      <match url="(.*)" />
      <conditions>
        <add input="{HTTPS}" pattern="^OFF$" />
      </conditions>
      <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
    </rule>
            </rules>
            </rewrite>
    </configuration>
    Thanks
    Last edited by FN-GM; 25th July 2012 at 06:50 PM.

  2. #2
    InterwebsGuy's Avatar
    Join Date
    Jan 2011
    Posts
    238
    Thank Post
    61
    Thanked 26 Times in 26 Posts
    Rep Power
    12
    If you are trying to redirect non-secure requests to a secure request, I use the following:

    <rule name="HTTPS Redirect" enabled="true" stopProcessing="true">
    <match url="(.*)" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
    <add input="{HTTPS}" pattern="^OFF$" />
    </conditions>
    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" />
    </rule>

SHARE:
+ Post New Thread

Similar Threads

  1. Exchange OWA URL redirection problem.
    By pinkerton in forum Internet Related/Filtering/Firewall
    Replies: 2
    Last Post: 28th March 2012, 11:45 AM
  2. IIS URL Rewrite - Change of URL but make old links work?
    By FN-GM in forum Windows Server 2008 R2
    Replies: 5
    Last Post: 27th March 2012, 12:25 PM
  3. How can I enable url rewrite/clean url for PHP apps on the EMBC Webserver
    By camel in forum East Midlands Broadband Consortium (EMBC)
    Replies: 3
    Last Post: 15th November 2010, 04:53 PM
  4. Moodle on IIS 7 with URL Rewrite
    By thesk8rjesus in forum Virtual Learning Platforms
    Replies: 0
    Last Post: 8th July 2010, 03:41 PM
  5. URL rewriting with Squid?
    By ChrisH in forum *nix
    Replies: 8
    Last Post: 14th November 2005, 10:35 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •