?
Solved

URL Rewrite and http to https

Posted on 2015-02-04
6
Medium Priority
?
97 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
[X]
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
  • 3
  • 2
6 Comments
 
LVL 17

Accepted Solution

by:
lruiz52 earned 2000 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 34

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
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 34

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 34

Expert Comment

by:it_saige
ID: 40592426
No problem.

-saige-
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

649 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