Link to home
Start Free TrialLog in
Avatar of lapucca
lapucca

asked on

Can't get URL Redirect to work for directing http to https

Hi,
I've followed these 2 url instructions and still when I use http it doesn't get redirected.  Instead I would get HTTP 404 error that the resource is not found.  Attached is the web.config from the web server.  I tried both "pattern="off" and pattern="^OFF$"  and they both didn't work.  
Also, in IIS, SSL Setting, I unchecked the "Required SSL".
I also removed this line form the web.config file, "        "<httpRedirect enabled="false" destination="" />"
But that didn't help solve the problem either.  What is this line for?  It was right before the Rewrite Rules section.
I'm attaching the Rules from my web.config file here.

Thank you.
HTTP.txt
Avatar of Mohammed Khawaja
Mohammed Khawaja
Flag of Canada image

What you need to do is use IIS Rewrite URL.  Instead of listing the steps, follow the link below:

http://www.jppinto.com/2010/03/automatically-redirect-http-requests-to-https-on-iis7-using-url-rewrite-2-0/
ASKER CERTIFIED SOLUTION
Avatar of it_saige
it_saige
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lapucca
lapucca

ASKER

It_Saige, thank you for that correction.  I removed it and it still doesn't work.  I then copy and past in your code and still the same http 404 error. Both times I restarted the website in IIS just to make sure.    It's very odd.

Hi Mohammed, one of the 2 url that I followed the instruction is the same as what you listed and this one, https://www.sslshopper.com/iis7-redirect-http-to-https.html   

The only difference in the end result code in web.config is at the pattern="off" or pattern="^OFF$f"  I tried both and neither fixed my http404 error.  Below is the full error I got:

Server Error in '/' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /apps/xxxx/AppDirectory.aspx
Could you post a copy of your web.config
Avatar of lapucca

ASKER

Hi,
Attached is my web.config file, thank you.
Web.config
You need to reupload the Web.config using a different extension.

-saige-
Avatar of lapucca

ASKER

Right, sorry about it.  Here it is.
Web.txt
I don' t see anything that really stands out.  You are not requiring SSL are you?User generated image-saige-
Avatar of lapucca

ASKER

No, I followed the instruction and turned that off by unchecking that checkbox that require SSL.  Below is the screen capture from the SSL setting for this site,
User generated image
Avatar of lapucca

ASKER

I think the SSL installed is the problem.  Thank you.