Can redirect to HTTPS by IP address?

Hi.
A certain folder on my website will be secured with SSL, so the web.config file in that folder contains the following code.   Because I can't put it in Production to test it, I test the site with the IP address.   However, I get an "error 500" when I browse to a page in that folder.  The server doesn't seem to append the "https://" to the page address, as I understand it should.  Is it because I am browsing using an IP address rather than a domain name?

I am working on getting screen captures, which I will try to post here.
Any suggestions?

<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<system.webServer>
		<rewrite>
			<rules>
				<remove name="Redirect to HTTP" />
				<rule name="Redirect to HTTPS" enabled="true" stopProcessing="true">
					<match url="(.*)" />
					<conditions>
						<add input="{HTTPS}" pattern="^OFF$" />
					</conditions>
					<action type="Redirect" url="https://{ToLower:{HTTP_HOST}{REQUEST_URI}}" appendQueryString="false" redirectType="Permanent" />
				</rule>
			</rules>
		</rewrite>
	</system.webServer>
</configuration>

Open in new window

Rob RudloffIT Development SpecialistAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Brad GrouxSenior Manager (Wintel Engineering)Commented:
Yes, it is because you are browsing via IP address. SSL certificates are tied to the FQDN listed within the certificate, generally under the "Issued to" byline. The exception is wildcards (ex: *.google.com), but you can't wildcard IP addresses in an SSL.
0
Phil PhillipsDirector of DevOps & Quality AssuranceCommented:
As Brad said, it has to do with how SSL certs are tied to Fully Qualified Domain Names. One thing you can try for testing is editing your local "hosts" file to force your computer to use the test IP for the production domain.

Here's a good guide to follow for modifying your hosts file: http://www.rackspace.com/knowledge_center/article/how-do-i-modify-my-hosts-file
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rob RudloffIT Development SpecialistAuthor Commented:
Thanks Guys.

Please see my next question, in case you have seen this weird situation before:
http://www.experts-exchange.com/Networking/Protocols/DNS/Q_28635958.html
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SSL / HTTPS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.