# http::path trailing slash

**URL:** <https://community.f5.com/t/http-path-trailing-slash/56231>\
**Category:** Technical Forums\
**Tags:** dev, irules, devops, application-delivery\
**Created:** [July 31, 2013, 9:16pm UTC](https://community.f5.com/t/http-path-trailing-slash/56231 "2013-07-31T21:16:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwhitene](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jwhitene](https://community.f5.com/u/jwhitene)\
**Post date:** [July 31, 2013, 9:16pm UTC](https://community.f5.com/t/http-path-trailing-slash/56231/1 "2013-07-31T21:16:28Z")

</div>

iRule for a port 443 virtual server with ssl.

when HTTP\_REQUEST {

if { [HTTP::path] starts\_with “/GoogleAltLogin-2.0.7” } {

pool googleAltLogin

} elseif { [HTTP::path] starts\_with “/banner-mobileserver” } {

pool MobileServer

} elseif { [HTTP::path] starts\_with “/banner-mobileserver/” } {

pool MobileServer

} else {

pool HTTP\_80

}

}

This works: [https://mysite/banner-mobileserver/](https://mysite/banner-mobileserver/) - It correctly chooses the “MobileServer” pool, and I am able to see a ‘welcome to grails’ page.

This does not work: [https://mysite/banner-mobileserver](https://mysite/banner-mobileserver) - It appears to be using the “else” choice and using pool HTTP\_80

If I bypass the load balancer and do WGET’s locally on the server, it works with or without a trailing slash, so it is for sure the F5.

How can I make the F5 use the “MobileServer” pool for a URL that either has, or does not have, a trailing slash?

---

<div class="post-metadata">

**Author:** ![Kevin\_Stewart](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/kevin_stewart/32/15267_2.png) [@Kevin\_Stewart](https://community.f5.com/u/Kevin_Stewart)\
**Post date:** [August 1, 2013, 2:34am UTC](https://community.f5.com/t/http-path-trailing-slash/56231/2 "2013-08-01T02:34:57Z")

</div>

Could it perhaps be something else in the request process causing this? Are you trying this with a browser or cURL? Please try this version and report the results:

```tcl
when HTTP_REQUEST {
log local0. "path = [HTTP::path]"
log local0. "uri = [HTTP::uri]"
if { [HTTP::path] starts_with "/GoogleAltLogin-2.0.7" } {
log local0. "google"
pool googleAltLogin
elseif { [HTTP::path] starts_with "/banner-mobileserver/" } {
log local0. "slash"
pool local-pool
} elseif { [HTTP::path] starts_with "/banner-mobileserver" } {
log local0. "no slash"
pool local-pool
} else {
log local0. "default"
pool local-pool-single
}
}

```

---

<div class="post-metadata">

**Author:** ![jwhitene](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jwhitene](https://community.f5.com/u/jwhitene)\
**Post date:** [August 1, 2013, 5:52pm UTC](https://community.f5.com/t/http-path-trailing-slash/56231/3 "2013-08-01T17:52:09Z")

</div>

Sorry, this ended up having nothing to do with the F5. It is a quirk of tomcat.

Looking at the http headers, typing in “[https://mysite/tomcat-webapp](https://mysite/tomcat-webapp)” , and I could see that there was a 302 redirect to “[http://mysite/tomcat-webapp/](http://mysite/tomcat-webapp/)” issued by tomcat.

Thank you for the reply though.

---

<div class="post-metadata">

**Author:** ![Kevin\_Stewart](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/kevin_stewart/32/15267_2.png) [@Kevin\_Stewart](https://community.f5.com/u/Kevin_Stewart)\
**Post date:** [August 1, 2013, 5:54pm UTC](https://community.f5.com/t/http-path-trailing-slash/56231/4 "2013-08-01T17:54:49Z")

</div>

If you set “redirect rewrite” to “matching” in the HTTP profile, it’ll catch these HTTP 30x redirects and rewrite them to HTTPS automatically.
