Forum Discussion
Mike_Wethington
May 01, 2009Nimbostratus
Redirect domain.com to www.domain.com
When users type http://domain.com i need to redirect them to http://www.domain.com, how do i do this?
hooleylist
May 01, 2009Cirrostratus
Or you can use an iRule:
when HTTP_REQUEST {
Check if there was a host header value doesn't start with www. and does start with an alphabet character
if { not ([string match -nocase www.* [HTTP::host]]) && [string match -nocase a-z* [HTTP::host]]}{
HTTP::redirect "http://www.[HTTP::host]"
}
}
Or something more specific:
when HTTP_REQUEST {
Check if the host header value isn't www.domain.com
if { not ([string tolower [HTTP::host]] eq "www.domain.com") }{
HTTP::redirect "http://www.domain.com"
}
}
Aaron
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