Solved

Url redirect

Posted on 2015-01-23
6
188 Views
Last Modified: 2015-01-28
Hi

I have the following domain , now i have assigned ssl certificate and made the bindings available for both http and https

domain :  aa.andr.ind.com

url: http://aa.andr.ind.com

and i am Using the  following  in web.config , and IIS 7.5 version.

</system.webServer>
<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>
</system.webServer>

but it is not redirecting to  https://aa.andr.ind.com  when i typed aa.andr.ind.com in browser, could you please say me what the problem with above configuration/Coding.

                    Many thanks.
0
Comment
Question by:praveen1981
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:Zsolt Pribusz
Comment Utility
Just looking at your code, I spotted is that, you start with a closing </system.webServer>
Remove the unnecessary / from the first entry.
0
 
LVL 32

Accepted Solution

by:
it_saige earned 500 total points
Comment Utility
Zsolt's reponse is valid but I also think your pattern is a bit *off*.  Here is an example redirect from one of my servers, i.e. -
  <system.webServer>
        <rewrite>
            <rules>
                <rule name="HTTP to HTTPs" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="off" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Found" />
                </rule>
            </rules>
        </rewrite>
  </system.webServer>

Open in new window

-saige-
0
 

Author Comment

by:praveen1981
Comment Utility
Hi saige,

I have used the same as you suggested , but still no use.

is there any thing need to added ?
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 32

Expert Comment

by:it_saige
Comment Utility
What does your entire web.config consist of (please modify any sensitive information like user names and/or passwords)?

Also, does the rewrite rule show in IIS for your site?Capture.JPGCapture.JPG-saige-
0
 

Author Comment

by:praveen1981
Comment Utility
Hi Saige,

 Many thanks, now it working perfectly.
0
 

Author Closing Comment

by:praveen1981
Comment Utility
Many thanks
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

11 Experts available now in Live!

Get 1:1 Help Now