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

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?
Ricky11Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

KennyTMCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ricky11Author Commented:
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
Ricky11Author Commented:
so when i do specify https...

should be as abvoe...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.