Re-writing a client request from http:// to https://Many sites are now https only, banking, e-commerce, shopping, and many more. However, end users are not always willing to remember prefixing their request with https:// -- indeed, they never need to as ZXTM and trafficscript provides a simple server solution!
$url = http.getRawURL();
$host = http.getHeader ( "Host");
if( string.regexmatch( $url, "^/foo/(.*)$" ) ) {
http.sendResponse( "301 Moved Permanently", "text/html", "", "Location:
https://".$host . $url);
}
This trafficscript will ensure that any http request matching /foo/any/further/path will be re-written as https. So, a customer can request:
Yet, their request will be transparently re-written to:
Chris Buckley
[Zeus Support] 23 August 2006
Comments:This public messageboard is not a forum for technical support. To report technical support problems, please contact our dedicated Support team using the instructions at the bottom of this page.
Comment from:
mrz [Visitor]
A simpler rule is:
http.changeSite("https://" . http.getHeader ( "Host")); |
Recent Articles
Other Resources
|


