Advertisement

10.05.2003 at 12:58PM PDT, ID: 20757759
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Redirect to HTTPS

Tags: redirect, https, iis
Hello,

How can I configure IIS 5 to redirect a website (virtual directory) to a secured site? When users type http://www.website.com/website they get an error and I have to tell them to insert a 's' in after the http(s) to make it viewable. Basically I want to configure IIS to automatically redirect them when they type http://www.website.com/website to https://www.website.com/website? Can someone please assist me?

Thanks in advance

Nabs
Start your free trial to view this solution
Question Stats
Zone: Software
Question Asked By: Nabsdar
Solution Provided By: daniel_c
Participating Experts: 6
Solution Grade: A
Views: 521
Translate:
Loading Advertisement...
10.05.2003 at 07:24PM PDT, ID: 9495907

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.06.2003 at 06:57AM PDT, ID: 9498250

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.06.2003 at 02:33PM PDT, ID: 9501359

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.07.2003 at 07:56AM PDT, ID: 9506245

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.07.2003 at 12:02PM PDT, ID: 9508276

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.08.2003 at 07:03AM PDT, ID: 9513369

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.08.2003 at 09:19AM PDT, ID: 9514366

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.08.2003 at 10:52AM PDT, ID: 9514984

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.08.2003 at 11:47AM PDT, ID: 9515368

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.08.2003 at 11:51AM PDT, ID: 9515401

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.08.2003 at 12:52PM PDT, ID: 9515938

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.08.2003 at 01:16PM PDT, ID: 9516152

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.08.2003 at 02:02PM PDT, ID: 9516493

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.08.2003 at 10:28PM PDT, ID: 9518480

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.09.2003 at 10:17AM PDT, ID: 9522196

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
10.09.2003 at 10:41AM PDT, ID: 9522359

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.09.2004 at 03:16PM PST, ID: 10555833

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.03.2005 at 03:07AM PST, ID: 13448075

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
10.05.2003 at 07:24PM PDT, ID: 9495907
Add small snippet in your default.asp

<%
  bSSLOn = (Request.ServerVariables("HTTPS") = "on")
  if not bSSLOn then
    sURL = "https://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL")
    if Request.ServerVariables("QUERY_STRING") <> "" then
      sURL = sURL & "?" & Request.ServerVariables("QUERY_STRING")
    end if
    Response.Redirect sURL
  end if
%>

HTH.
 
10.06.2003 at 06:57AM PDT, ID: 9498250
Thanks for your prompt input but is this not going to effect the entire website? I am just looking for redirection on a virtual directory http://www.website.com/virtual_directory.com to an https. Please advice

Thanks again,
Nabs


 
10.06.2003 at 02:33PM PDT, ID: 9501359
Other things might be set your virtual home directory properties, instead to specific folder, make it to specific url:
https://www.website.com/virtual_directory

 
10.07.2003 at 07:56AM PDT, ID: 9506245
This solution is not working very well for me! Any other ideas anyone?

Thanks
Nabs
 
10.07.2003 at 12:02PM PDT, ID: 9508276
Simpler solution:
1. Create one html page, name it redirectssl.htm and save it into your virtual directory folder. Here is the redirectssl.htm content:
<script language=javascript>
      self.location = "https://www.website.com/virtual_directory.com "
</script>
<noscript>
<META HTTP-EQUIV=Refresh CONTENT="1; URL=https://www.website.com/virtual_directory.com ">
</noscript>

2. Open your IIS, right click on your virtual directory site, click Properties.
3. Switch to Custom Error Tab
4. Edit properties of 403;4.
5. Set message type to FILE
6. Click browse button and point it into your redirectssl.htm
7. Click OK button twice.

Now try to put http://www.website.com/virtual_directory.com  (without s).

HTH.
 
10.08.2003 at 07:03AM PDT, ID: 9513369
You need something similar to Apache's Rewrite....

http://www.isapirewrite.com/

This tool will let your server redirect URLs based on various criteria.

ShalomC
 
10.08.2003 at 09:19AM PDT, ID: 9514366
Hello daniel_c

You are definitely on the right track with the last solution to my problem but it still does not work! Please advice further.

Thanks for your time,
Nabs
 
10.08.2003 at 10:52AM PDT, ID: 9514984
it does not work? you mean it doesn't redirect?
 
10.08.2003 at 11:47AM PDT, ID: 9515368
Yes, it does not redirect.
 
10.08.2003 at 11:51AM PDT, ID: 9515401
Post your HTML file code. I need to see it.
 
10.08.2003 at 12:52PM PDT, ID: 9515938
Okay it worked!
I had put in the wrong code!

Thanks daniel_c: so now to apply this to our current directory, should I just insert this code in it or how do I go about this?

I really appreciate your help
Nabs

 
10.08.2003 at 01:16PM PDT, ID: 9516152
One other problem:

I don't see the contents of the page. It redirects it to https but its just a page with an error!
Why?
 
10.08.2003 at 02:02PM PDT, ID: 9516493
so now to apply this to our current directory, should I just insert this code in it or how do I go about this?
--> just need to insert that code (in fact, thanks to your post, i'm using it myself for my server now)

I don't see the contents of the page. It redirects it to https but its just a page with an error!
--> what error now?
Accepted Solution
 
10.08.2003 at 10:28PM PDT, ID: 9518480
Each website has a default document, the redirect should be named that (I.E. default.htm)

The target website has a document you want people to load, so specify it in the code.

---
script language=javascript>
     self.location = "https://www.website.com/virtual_directory/HTMLfileNAME.HTM "
</script>
---
 
10.09.2003 at 10:17AM PDT, ID: 9522196
Thanks daniel_c fir putting me on the right direction. I finally got it to work perfectly!!

Nabs

 
10.09.2003 at 10:41AM PDT, ID: 9522359
Great!!!
 
03.09.2004 at 03:16PM PST, ID: 10555833
We use an SSL accerlerator so ASP doesn't see the request as HTTPS.  I came up with the code below to perform the redirect using JavaScript since the client always sees the request as SSL.

<SCRIPT LANGUAGE="JavaScript">
if (location.protocol != 'https:'){
      window.location= 'https://' + location.host + location.pathname + location.search
}
</SCRIPT>
 
03.03.2005 at 03:07AM PST, ID: 13448075
Just wanted to post my solution.
Basicaly same as above by Daniel

1. Open your IIS, right click on your virtual directory site, click Properties.
2. Switch to Custom Error Tab
3. Edit properties of 403;4.
4. Set message type to FILE
5. Click browse button and point it into your redirect.htm
6. Click OK button twice.


redirect.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>API E-MAIL SERVER</title>
<meta http-equiv="REFRESH" content="1;url=https://site/exchange"></HEAD>
<BODY>
Loading... https://site/exchange
</BODY>
</HTML>

note:
content="1  - is the time in seconds it will take to redirect
 
 
12.21.2007 at 12:26PM PST, ID: 20516146
Another (and perhaps better) way is to have two websites - one that accepts host headers for mysite.com, .org, .net and whatever else you want. Everything is on port 80. In the Home Directory tab in IIS manager, set it to "A redirection to a URL". Enter https://mysite.com. Also check the permanent redirect box.
Next, in the site you want to force SSL, make sure it also responds to the mysite.com host header, but change the port to something high - make sure its unreachable behind your firewall. Set the security as necessary and you're done.
 
 
 
20080236-EE-VQP-29