Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to send any request to https

Posted on 2014-12-04
5
Medium Priority
?
113 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
  • 3
  • 2
5 Comments
 
LVL 15

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 15

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

885 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