Lucilius_223799
Jul 03, 2017Nimbostratus
Datagroup Irule matching
I have been trying to make my code match for both host and uri. For example
- :=
-
:=
when HTTP_REQUEST { set locationHttps [class match -value [HTTP::host] equals list-https] set locationHttp [class match -value [HTTP::host] equals list-http] if { $locationHttps ne ""} then { HTTP::respond 301 location "https://$locationHttps[HTTP::uri]" return } if { $locationHttp ne ""} then { HTTP::respond 301 location "http://$locationHttp[HTTP::uri]" return } }
Right now the datagroup file uses:
"www.example.com" := "www.different.com",
"www.example.com/index.aspx" := "beta.example.com",
"www.interesting.com/en" := "app.example.com",
I noticed that everything behind the / either won't work or is taken with the url to the next one so I cannot hard edit behind the /. This was noticable when behind the /abcdef had to change into /abc-def
Is anyone able to help me along the right path to make URI work correctly?
I wasn't sure if I needed a new datagroup specific for the URI so I made one with the more common /en /index entries with empty ""
Every bit of help is welcome!