![]() |
| Most Wanted ASP and ASP .Net Scripts |
|
Jitu
HostMySite Tier2 Tech
|
Please feel free to post commonly used scripting questiosn and solutions here.
Right now we are looking for an asp redirect script that would redirect the a user from a nonsecure link to a secure link for certain pages. For example when some one goes to http://www.domain.com/login.asp they are redirected to https://www.secureurl.com/domain/login.asp Please post any sample script that might help us achieve that. Thanks. |
||||||||||||
|
|
|||||||||||||
|
cpnet
|
The following code works for me...
|
||||||||||||||
|
|
|||||||||||||||
| Thats Good but this might save space in code |
|
mdegeofroy
|
place at top of script <!--#include file="ForceSSL.inc" --> in page to protect
make text file with code (same code as before) <% Response.Buffer = True SecSrv = "https://www.secureurl.com/domain" If (UCASE(Request.ServerVariables("HTTPS")) <> "ON") Then Response.Clear Response.Redirect( SecSrv & Request.ServerVariables("PATH_INFO")) End if %> save it in same directory as file to protect and name it - ForceSSL.inc now you can add one line in all pages to protect I am not a pro so try it do not take my word for it but it works for me:) |
||||||||||||
|
|
|||||||||||||
| Correction |
|
mdegeofroy
|
Not .inc (no security ) .asp (cannot be browsed)
place at top of script <!--#include file="ForceSSL.asp" --> in page to protect make text file with code (same code as before) <% Response.Buffer = True SecSrv = "https://www.secureurl.com/domain" If (UCASE(Request.ServerVariables("HTTPS")) <> "ON") Then Response.Clear Response.Redirect( SecSrv & Request.ServerVariables("PATH_INFO")) End if %> |
||||||||||||
|
|
|||||||||||||
| Most Wanted ASP and ASP .Net Scripts |
|
||
|


