Redirect HTTP to HTTPS and maintain original URL

Posted by kberton

If you have a need to redirect all incoming HTTP requests to a Vport to HTTPS *and* also maintain the original URL info, then it can be done easily using aFlex.

#redirect to HTTPS
#maintain original host and uri

when HTTP_REQUEST {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}

Comments

  • dmcdonalddmcdonald Member
    edited July 2014
    I found that I had to remove the quotation marks for this to work properly:

    #redirect to HTTPS
    #maintain original host and uri

    when HTTP_REQUEST {
    HTTP::redirect https://[HTTP::host][HTTP::uri]
    }
  • dshindshin Member
    edited July 2014
    Keep in mind that pre canned redirect(commonly used) aFlex scripts are also available on the ACOS under Config>SLB>aFleX> 1. redirect1 2. redirect2 3. redirect_rewrite

    Genard
Sign In or Register to comment.