Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi, I have a shopping cart website that has SSL certificate installed. all the aspx pages can be accessed either with http:// or https:// prefix. but I only want to show https:// prefix if the page name ends with either "checkout.aspx" or "confirmorder.aspx" and entire site should stay http:// for rest of the pages. The current rewrite I have is

XML
<rules>
    <rule name="Redirect to HTTPS" stopprocessing="true">
        <match url="(.*)" />
        <conditions>
            <add input="{URL}" pattern="^.CheckOut\.aspx$" ignorecase="true" />
            <add input="{HTTPS}" pattern="^OFF$" />
        </conditions>
        <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirecttype="Permanent" />
    </rule>
</rules>


but I want to put confirmorder.aspx in it as well. It works when user is redirected to checkout.aspx but when I come to home page I still see https:// so it is not really working. could someone please help how to do it.
Posted
Updated 26-Nov-13 13:49pm
v4

1 solution


  1. Go learn Regular Expressions. It will change your life. Seriously.
  2. If what you have works the way you want, just change the first condition to
    XML
    <add input="{URL}" pattern="(CheckOut|ConfirmOrder)\.aspx$" ignorecase="true" />his will match both cases (see #1).
  3. Don't do this. Please. Make the whole site HTTPS, or convince me why you shouldn't. Here are some good reasons to do so:

  • More security is always better than less security.
  • It will give site visitors more confidence.
  • Most people are more concerned that people find out what vibrator, blow-up doll, ammunition, prescription drugs, adult diapers, books, movies, tampons, and _____ they are putting in their cart than they are about someone finding out their credit card number. The former could cost them their career or spouse, the latter is usually capped at fifty bucks.
  • Your shopping cart is none of the NSA's business.
  • It costs you nothing. (well, if your site is busy enough to need 500 servers, it will now need 502.
  • Top 7 Myths about HTTPS
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900