Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Url redirect

Posted on 2015-01-23
6
Medium Priority
?
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 34

Accepted Solution

by:
it_saige earned 1500 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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 34

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

618 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