problem with https redirect - IIS7

Posted on 2011-05-03
Last Modified: 2012-05-11
I am currently doing a https redirect using the following rule:

I have other sites (that I don't have control over) that link to this site using the http protocol.

However, I am having issues with the query string in the URL.

If the URL is, it gets redirected to

I can't figure out how the extra "afis" is getting added?

any ideas?
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
					<match url="(.*)" />
					<!-- Require SSL must be OFF in the site settings -->
						<add input="{HTTPS}" pattern="off" ignoreCase="true" />
					<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}{REQUEST_URI}" />

Open in new window

Question by:IUAATech
    1 Comment
    LVL 50

    Accepted Solution

    It is because {REQUEST_URI} includes the query string.  If you have not defined appendQueryString in your action, it is assumed to be true, so it is added again to the end of the rewritten URL.

    <action type="Redirect" appendQueryString="False" redirectType="Found" url="https://{HTTP_HOST}{REQUEST_URI}" />

    Open in new window


    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Today I came across an interesting issue that had me pulling my hair out.  I was troubleshooting a new internal web site which uses integrated security instead of anonymous.  When browsing the site from my laptop, I was able to access it with no iss…
    What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now