Solved

URL Rewrite and http to https

Posted on 2015-02-04
6
85 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 32

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 32

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 32

Expert Comment

by:it_saige
ID: 40592426
No problem.

-saige-
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Today I came across an interesting issue that had me pulling my hair out.  I was troubleshooting a new internal web site which uses integrated security instead of anonymous.  When browsing the site from my laptop, I was able to access it with no iss…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now