navigate from a regular page to a secured page

C

c676228

Hi all,

What is the best way to lead customer from a regular page to a secured page?
Regularly, we use absolute path. say first ,a customer is on this regular
page for general information: http://xxxdomain.com/index.html, then customer
decides to buy something from our site. Then our program will provide an
absolute path like this: https://xxxdomain.com/buy.asp.

Recently I am doing migration and feel that the absolute path is not
convenient for program migration and domain merge. So I am wodering if there
is any other way to do it? any suggestions and comments?
 
A

Anthony Jones

c676228 said:
Hi all,

What is the best way to lead customer from a regular page to a secured page?
Regularly, we use absolute path. say first ,a customer is on this regular
page for general information: http://xxxdomain.com/index.html, then customer
decides to buy something from our site. Then our program will provide an
absolute path like this: https://xxxdomain.com/buy.asp.

Recently I am doing migration and feel that the absolute path is not
convenient for program migration and domain merge. So I am wodering if there
is any other way to do it? any suggestions and comments?


Since the start of the path changes from http to https what the client uses
has to be an absolute path.

It's a little bit awkard to do this in a html file since it gets no help
server side.
If you had a default.asp instead of index.html then :-

Dim sSecureBase
sSecureBase = "https://" & Request.ServerVariables("SERVER_NAME")

<a href="<%=sSecureBase%>/buy.asp"> ... </a>


If you have a lot of HTML that you don't want to change then you could leave
buy.asp available as http://xxxdomain.com/buy.asp and use this code in the
top :-

If Request.ServerVariable("HTTPS") = "OFF" Then
'Channel not secure
Response.Redirect "https://" & _
Request.ServerVariables("SERVER_NAME") & _
Request.ServerVariables("UNENCODED_URL")
Response.End
End If

You place this code in its own .asp file then include it in all ASP pages
that should be secure.
 
C

c676228

Hi Anthony,
Thank you so much for your response. I will take your second suggestion
since we have separated person to develop marketing content without any
knowledge about asp. With this piece of code, we can take care of any third
party agents who link to our sale processes using http.

Sincerely
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top