Forum Discussion
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]" }
- Lee_Payne_53457Cirrostratus
You could use the HTTP::respond command to do this.
when HTTP_REQUEST { HTTP::respond 301 "Location" "[HTTP::host][HTTP::uri]" }
- Vik_K_236702Historic F5 Account
Hi
Here is a nice article for you to study on this :
https://devcentral.f5.com/codeshare/http-to-https-redirect-301
And yes its on the lines of what Lee has responded :) .
Hope it helps!
Cheers! Vik
- sysadmin_2015_2Nimbostratus
Thank you for your help!
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com