Forum Discussion

Tim_Cullen_8971's avatar
Tim_Cullen_8971
Historic F5 Account
Nov 17, 2006

HTTP URI appending

I have looked through the posts and I see some "close" iRules but what I found hasn't worked.

 

 

The situation is this:

 

customer comes in to a site,

 

http://www.customer.com

 

 

The webserver used to redirect them to,

 

http://www.customer.com/customer_site_one

 

thus appending a uri on each connection request. There are a few different variations here but I can replicate for the extra uri's once I get this one to work.

 

 

The customer wants us to now do the redirect and switch them to SSL. For this, I did the standard http to https rewrite iRule on the port 80 VIP as below,

 

 

 

when HTTP_REQUEST {

 

HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]

 

}

 

 

 

 

 

I then added the iRule below on to the 443 VIP,

 

 

when HTTP_REQUEST {

 

if { [HTTP::uri] equals "/"} {

 

[HTTP::uri] "/Customer_uri_one"

 

}

 

HTTP::header replace Host: customer.com

 

}

 

 

 

So to sum up. Customer comes in to http://www.customer.com. They should be pushed to https://customer.com/customer_uri_one.

 

 

 

I get a 404 error when I do this. Any ideas? I'm sure it is something silly that I am doing wrong but I wanted to check with the DevNinja's to see your Kung Fu.

 

 

TIA,

 

TC

4 Replies

No RepliesBe the first to reply