Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Whats the best way to get out of https and back to http

Posted on 2006-04-22
3
Medium Priority
?
177 Views
Last Modified: 2010-04-09
Many of my links on my pages are "../products.asp" etc... i..e they dont all have http://www.website.com/product.asp

so now some of my pages are https for example like my checkout pages.. but suppose if a user clicked on a link from within a https page like a  help link...   now the help link need not be secure right??  so in this case it should go back to http://.....  instead of https://

becuase my help page link is simply "help.asp" and not the full path it prepends the link with the current server protocol.

so whats the best way that many websites use to get out of https and back to http.?

i know that i can have a script that detects the protocol and can redirect right but is this the best way?  if it is, can someone tell me that script?
0
Comment
Question by:Ricky11
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
KennyTM earned 2000 total points
ID: 16516036
Suppose your ASP always run under HTTP, not HTTPS.

You note that HTTPS use port 443 while HTTP use port 80.

So you may try putting this before the ASP actually begins:

<%
If Request.ServerVariables("SERVER_PORT") <> 80 Then
  Response.Redirect "http://www.website.com"  & Request.ServerVariables("URL")
End If
%>

Hope this helps.
0
 

Author Comment

by:Ricky11
ID: 16516078
Yeah okay.. but the problem is the page will be in https... becuase the user would have clicked on a link from within a secure page, and that link will take on the https protocol.. so it would also be in port 443.

as i mentioned my links do not have the full url they are like "products.asp" or "help.asp" etc..

so when i do specify http://mysite.com/entercreditcard.asp then if the user decides to click on products.asp from within the secure page.. https will be attatched to the link as https://mysite.com/products.asp  ...

so how do i change that so only certian pages are https... without going in and changing all my pages to the full url..

0
 

Author Comment

by:Ricky11
ID: 16516081
so when i do specify https...

should be as abvoe...
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

581 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