Forum Discussion
amebiz_142234
Mar 14, 2018Nimbostratus
protocol and sub domain redirect
hi guys, i want to redirect like that:
http://domain.com -> https://www.domain.com
http://domain.com/something -> https://www.domain.com/something
http://www.domain.com -> https://www.domain.com
http://www.domain.com/something -> https://www.domain.com/something
is that just with one redirect possible would be nice (google ranking) any ideas?
I don't know if this is the most straightforward way of doing it or not but I hope this works for you:
when HTTP_REQUEST { switch [HTTP::host] { domain.com { HTTP::redirect "https://www.domain.com[HTTP::uri]" } www.domain.com { HTTP::redirect "https://www.domain.com[HTTP::uri]" } } }
I don't know if this is the most straightforward way of doing it or not but I hope this works for you:
when HTTP_REQUEST { switch [HTTP::host] { domain.com { HTTP::redirect "https://www.domain.com[HTTP::uri]" } www.domain.com { HTTP::redirect "https://www.domain.com[HTTP::uri]" } } }
- Stanislas_Piro2Cumulonimbus
you can do it with a LTM Policy
rule :
- condition : HTTP-host host any of domain.com
- action : http-reply redirect tcl:https://www.domain.com[HTTP::uri]
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects