Forum Discussion
Geoff_34657
Nimbostratus
Nov 13, 2009HTTP 301
Hello I have a few GTMs and 8 LTMs running and I am trying to get a 301 redirect working for many of our domains from domain.com to www.domain.com. I have tried many of the iRules that I could find from doing a search. Everytime I try one it attempts to redirect but, I get a page could not be displayed. I have tried the one below and many others just like it. I do have to preserve the full URL. Do I have to run different Virtual Hosts to make this work properly? I would rather not clutter up the LTMs with extra virtual servers. I have tried the ones below and many other forms of the ones that I got off of this site.
1. when HTTP_REQUEST {
if {[HTTP::host] eq "domain.com" }
{ HTTP::redirect "http://www.domain.com[HTTP::uri]" } }
2. when HTTP_REQUEST { HTTP::respond 301 "Location" "http://www.[HTTP::host][HTTP::uri]"}
- hoolio
Cirrostratus
If you use just the first rule, does it work? If not, do you see any TCL errors in /var/log/ltm? - Geoff_34657
Nimbostratus
Alright for some reason it is now working. Hmm I will have to test externally to make sure it is working properly. Thanks for the reply.
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