Forum Discussion
301 Redirect only the root URL nothing underneath.
I have a site where I'd like to only redirect the top URL but nothing underneath.
For example somone goes to www.xxx.com and gets a 301 redirect but if the go to www.xxx.com/test it will take them to the specified location
this redirects but redirects everything
switch [string tolower [HTTP::host]] { "www.xxx.com" - "xxx.com" - "www.yyy.com" {HTTP::respond 301 Location ""}
2 Replies
- Stanislas_Piro2
Cumulonimbus
if your ltm version is 11.4 or above, you can use local traffic policies with both http-host and http-uri conditions instead of configuring irules.
- nathe
Cirrocumulus
Joe,
You'll need to put in some logic to capture the URI too. Something like
if { [HTTP::uri] eq "/"}{You could place this above your switch command.
Hope this helps,
N
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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