"c676228" <be***@newsgrou p.nospamwrote in message
news:C0******** *************** ***********@mic rosoft.com...
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.ServerV ariables("SERVE R_NAME")
>%
<a href="<%=sSecur eBase%>/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.ServerV ariable("HTTPS" ) = "OFF" Then
'Channel not secure
Response.Redire ct "https://" & _
Request.ServerV ariables("SERVE R_NAME") & _
Request.ServerV ariables("UNENC ODED_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.
--
Anthony Jones - MVP ASP/ASP.NET