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:

http://www.foo.bar/foo/foo/bar/

Yet, their request will be transparently re-written to:

https://www.foo.bar/foo/foo/bar/

Chris Buckley [Zeus Support] 23 August 2006 Bookmark with del.icio.us Post this article to Digg Post this article to reddit Post this article to Facebook Tweet this article 5 comments  

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"));
Permalink 10 August 2008 @ 06:26
Comment from: Steve [Visitor] · http://www.maximus.com
How can you do this with RuleBuilder?
Permalink 02 December 2008 @ 22:37
Comment from: kpfoote [Visitor]
This can be done fairly easily with only RuleBuilder.

- First create your service tied to your service name and port 80 then set the pool to discard.

- Next create a new rule Catalogs -> Rules
- In that rule leave Conditions empty
- Under the Actions tab / Requests and Responses section
. select Log Information stating what you want (you can skip this if you want)
. select HTTP only / HTTP Redirect telling it where you want the request to go. ie the full https://blablabla.bla.bal
Permalink 30 April 2009 @ 12:42
Comment from: bika [Visitor] · http://www.go_there.com
How do I redirect https traffic?
Thanks!
Permalink 28 July 2009 @ 21:04
Comment from: Owen Garrett [Zeus Dev Team]
Bika - first, you need to decrypt the traffic using the SSL settings of the virutal server. Then, apply a rule to send the redirect, using either TrafficScript (comment 1 above) or RuleBuilder (comment 3)
Permalink 29 July 2009 @ 09:37
Leave a comment ...
Your email address will not be displayed.
Your URL will be displayed.
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.
Options:
 
(Line breaks become <br />)
(Set cookies for name, email & url)

Recently...

Other Resources