Solved

URL Rewrite and http to https

Posted on 2015-02-04
6
87 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Here are the symptoms: You start receiving calls from users that one of your legacy web apps isn't coming up, so you log into your IIS 5 server to check it out.  When you pull up the services, you notice that the WWW Publishing service isn't runn…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

26 Experts available now in Live!

Get 1:1 Help Now