Solved

How to send any request to https

Posted on 2014-12-04
5
96 Views
Last Modified: 2014-12-27
HI

I have got typical problem in URL rewrite. the scenario is as mentioned below.

I have got domain abc.com and standard certificate procured  is in the name of www.abc.com. I have configured IIS with rules which takes any request (e.g. http://abc.com or http://www.abc.com) to https://www.abc.com and this is working fine.

however, when I tried accessing https://abc.com it gives certificate invalid error. my URL write rules are attached herewith.

The server is hosting  multiple sites and need to bind the SSL for abc.com and expected result is smooth error-free access of https://www.abc.com no matter how it is typed (e.g. http://www.abc.com, http://bac.com, https://abc.com and of course https://www.abc.com)

Pls. suggest the options possible without changing the SSL certificate.

web.config
0
Comment
Question by:Mickail
[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
5 Comments
 
LVL 14

Expert Comment

by:Edwin Hoffer
ID: 40480408
Hello Mickail,

Try the below code:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <clear />
                <rule name="Redirect to https" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                    </conditions>
                    <action type="Redirect" url="https://www.abc.com" redirectType="Permanent" appendQueryString="false" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Open in new window


Thanks
Edwin
0
 

Author Comment

by:Mickail
ID: 40481358
Hi Edwin

really appreciate for the response. however, still the problem remains the same.

let me re-iterate it again.

1. the ssl cert is in the name of www.abc.com
2. the website should be accessible without any certificate error  and go to https://www.abc.com thru any of the following URLs.
http://www.abc.com (it works with your rule)
http://abc.com (it works with your rule)
https://www.abc.com (it works with your rule)

Exception
http://abc.com  (its giving certificate error and does not go to https://www.abc.com works with your rule)

hope I am able to explain the situation clearly.

best regards.
0
 
LVL 14

Expert Comment

by:Edwin Hoffer
ID: 40482226
Hello Mickail,

Try the below code:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <clear />
                <rule name="Redirect to https" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                    </conditions>
                    <action type="Redirect" url="https://www.abc.com" redirectType="Permanent" appendQueryString="false" />
                </rule>
				<rule name="Redirect to WWW" stopProcessing="true">
					<match url=".*" />
					<conditions>
						<add input="{HTTP_HOST}" pattern="^abc.com$" />
					</conditions>
					<action type="Redirect" url="http://www.abc.com/{R:0}" redirectType="Permanent" />
				</rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Open in new window


This will redirect non www users to www

Thanks
Edwin
0
 

Accepted Solution

by:
Mickail earned 0 total points
ID: 40512616
This also didn't workout.

Client has now dropped the idea of running the domain without https://.  So this seems now resolved.
0
 

Author Closing Comment

by:Mickail
ID: 40519466
Client has now dropped the idea of running the domain without https://.  So this seems now resolved.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

710 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