Solved

Url redirect

Posted on 2015-01-23
6
194 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
ID: 40566597
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 33

Accepted Solution

by:
it_saige earned 500 total points
ID: 40566711
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
ID: 40572093
Hi saige,

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

is there any thing need to added ?
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 33

Expert Comment

by:it_saige
ID: 40572841
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
ID: 40574748
Hi Saige,

 Many thanks, now it working perfectly.
0
 

Author Closing Comment

by:praveen1981
ID: 40574751
Many thanks
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 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