Forum Discussion

sysadmin_2015_2's avatar
sysadmin_2015_2
Icon for Nimbostratus rankNimbostratus
Dec 03, 2015

iRule - https redirect - Google rating

Hello,

 

One of our sites has two virtual servers, one for port 80 and another for 443. The port 80 virtual server currently has a https redirect iRule attached sending all port 80 traffic to 443. I'm using the default F5 https redirect, please see below. Currently this is hurting our Google seo rating, google is picking it up as a 302 redirect and not a 301. Is there any way to change it so Google picks it up as a 301 redirect?

 

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

 

Thank you for your help,

 

  • You could use the HTTP::respond command to do this.

     

    when HTTP_REQUEST { HTTP::respond 301 "Location" "[HTTP::host][HTTP::uri]" }