Exforsys

Online Training

How to convert http to https.

This is a discussion on How to convert http to https. within the ASP forums, part of the Programming Talk category; Hi .. I m new in ASP... I have assigned a project in my university to develop any web page which ...


Go Back   Exforsys > Programming Talk > ASP

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-11-2007, 01:54 AM
Saqi
 
Join Date: May 2007
Location: Pakistan, Karachi
Posts: 5
saquib1982 is on a distinguished road
How to convert http to https.

Hi ..

I m new in ASP... I have assigned a project in my university to develop any web page which code is secure... so i need to convert http to https... If any one have some idea about this then plz plz help me.. Its urgent.....

Regards,
Saqi
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 09-02-2007, 04:38 PM
Junior Member
 
Join Date: Sep 2007
Posts: 4
JenniP is on a distinguished road
If you want to check if the page you are on is secure you can use

Request.ServerVariables("HTTPS") this will return "off" if its an HTTP page and "on" if its an https page.

So if your pointing at an HTTP page you then need to use a redirect to point to the HTTPS version of the page.

Because you are changing protocol you have to use a response.redirect rather than a server.transfer. This will also allow the web browser to check the SSL certificate.

So some code that will do this is below

if Request.ServerVariables("HTTPS") = "off" then
srvname = Request.ServerVariables("SERVER_NAME")
scrname = Request.ServerVariables("SCRIPT_NAME")
response.redirect("https://" & srvname & scrname)
end if

This will have a downside of losing any HTTP get/post data but will jump you to a secure session.

Jen
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-06-2007, 04:24 AM
Junior Member
 
Join Date: Sep 2007
Posts: 3
solar is on a distinguished road
Hi Jen

Great, thats a big help I was looking for for exactly this and Google bought me to you. I'm not worried about my get data, perfect solution - thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new questions
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Help me to convert Ralph COBOL 1 05-24-2007 03:36 PM
convert txt files to xml files srinivas babu C and C++ 2 03-13-2007 10:22 PM
How to convert the excel file to text file or rev file with user specified delimiters kvp_vivek Visual Basic Tutorials 2 12-04-2006 08:34 PM
Client side HTTP Upload software by eclairomnimedia JobHelper Microsoft.NET Offers 0 11-23-2006 03:50 AM
Kerberos FAQ, v2.0 (last modified 8/18/2000) Ken Hornstein Tech FAQ 0 04-17-2004 07:28 AM


All times are GMT -4. The time now is 07:34 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.