Forum Discussion

shawn306_84070's avatar
shawn306_84070
Icon for Nimbostratus rankNimbostratus
May 13, 2013

Simple redirect rewrite

I have a site that is using the following url

 

https://propworks.abc.com/propworks

 

Now the default http to https redirect works

 

 

when HTTP_REQUEST {

 

HTTP::redirect https://[HTTP::host][HTTP::uri]

 

}

 

 

Now, they would like it if a user just types "propworks" in the browser it redirects to the https url above.

 

 

So I went and tried this and had no luck.

 

 

when HTTP_REQUEST {

 

if { [HTTP::host] eq "propworks" } {

 

HTTP::redirect "https://propworks.abc.com/propworks"

 

}

 

}

 

 

 

I then tried

 

 

when HTTP_REQUEST {

 

if {[HTTP::host] eq "propworks.abc.com"} {

 

HTTP::redirect "https://propworks.abc.com[HTTP::uri]"

 

}

 

}

 

 

 

That did nothing either...

 

 

any thoughts ? This reallly has me aggravated right now :)

 

 

Thanks

 

 

Shawn

 

 

6 Replies

  • Are there actually DNS entries in place for 'propworks' and 'propworks.abc.com', which resolve to the VS IP?

     

  • OK, so that explains the issue when users use just propworks; there's no DNS resolution so the traffic never gets to the F5 and the rule never runs on that traffic.

     

     

    Regarding the third rule out of the three above, assuming it's applied to the HTTP VS then there's no need for it, the first rule covers it.
  • I was kinda wondering why when I put in propworks it did not redirect. I'll have our dns guy check it out.

     

     

    Thanks !!!!!