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
Solved

URL Rewrite and http to https

Posted on 2015-02-04
6
92 Views
Last Modified: 2015-02-05
Hello,

I'm running IIS 7. I need to have all attempts at http://www.domain.com/dir1/x.asp or whatever URL in the domain be redirected to use https. I'm assuming URL Rewrite is the best way to do this.

What is the rule that would do this for me?

Thanks in advance,

Steve
0
Comment
Question by:skbohler
  • 3
  • 2
6 Comments
 
LVL 17

Accepted Solution

by:
lruiz52 earned 500 total points
ID: 40589102
HI,

Check out the link below, it gives directions on setting up http redirects to HTTPS.

http://www.jppinto.com/2009/04/automatically-redirect-http-requests-to-https-iis-7/
0
 
LVL 33

Expert Comment

by:it_saige
ID: 40589362
When doing a URL rewrite, I use the URL Rewrite Moedule from Microsoft:  http://www.iis.net/downloads/microsoft/url-rewrite

1. Once installed, close and reopen IIS.

2. Browse to the site you want to create a Rewrite rule for.

3. Open the URL Rewrite module.

Capture.JPG

4. Add a rule using the Add Rule wizard

Click the 'Add Rule(s)...' shortcut.Choose 'Blank Rule' under the 'Inbound Rules' section.Type 'HTTP to HTTPs' in the Name textbox.In the 'Match URL' section, use the following settings.In the 'Conditions' section, add a new Condition with the following settings.This is how your 'Conditions' section should look after you add the new Condition.In the 'Action' section, make the following changes.Save the changes using the 'Apply' link.After applying the changes, reopen the URL Rewrite feature.  You should see your new rule.
-saige-
0
 

Author Comment

by:skbohler
ID: 40592145
I've put in the redirect location as: <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />

It works for the root URL (http://www.domain.com). However, when I try to browse directly to, say, http://www.domain.com/dir1/file.php, it redirects the browser to https://www.domain.com/index.php. It's not appending it seems.
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 33

Expert Comment

by:it_saige
ID: 40592335
Make sure that you do not have anything in the root web.config, the dir1 directory web.config (if one exists) or the fie.php file that redirects to index.php.

-saige-
0
 

Author Comment

by:skbohler
ID: 40592425
Thanks. It turned out to be another URL Rewrite entry ahead of it that was causing the issue.
0
 
LVL 33

Expert Comment

by:it_saige
ID: 40592426
No problem.

-saige-
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

First of all, clustering IIS is something you should rarely consider doing. In almost all cases, Microsoft Network Load Balancing (NLB) (http://technet.microsoft.com/en-us/library/cc758834(WS.10).aspx) is a much better solution when you need to p…
What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 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