Solved

Url redirect

Posted on 2015-01-23
6
192 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C#, asp.net MVC, sql server, LINQ 3 32
Javascript to set controls visibility 5 36
Modal Popup Extender control 1 20
Winform Module - What is the ASP.Net equiv 2 22
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 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