Forum Discussion

Bob_10976's avatar
Bob_10976
Icon for Nimbostratus rankNimbostratus
Sep 20, 2018

redirect root URL to another URL

I have a public facing url cdn.mydomain.com that I need to redirect to mydomain.com if anyone goes to that site. There is nothing on the cdn website, it simply exist to feed other sites withing our environment, but has to maintain a public facing presence. The issue I have is cdn.mydomain.com is being used in several other websites for varies purposes but when I setup the redirect it break all the other sites. Below is the irule I've tried to get working. I've attempted it with just the equals "/" option but didn't change anything, other sites that call the cdn would get redirected as well. Am I missing something?

 

when HTTP_REQUEST { if { ([string tolower [HTTP::host]] equals "cdn.mydomain.com") || ([string tolower [HTTP::host]] equals ";)} { HTTP::respond 301 Location https://mydomain.com/ }

 

}

 

No RepliesBe the first to reply