---
title: req.url.basename
summary: null
url: >-
  https://www.fastly.com/documentation/reference/vcl/variables/client-request/req-url-basename
---

**Type:** STRING  
**Access:** read-only

**Available in:** all subroutines

The file name specified in a URL. This will be the last component of the path, 
from the last `/` to the end, not including the query string.

## Example

In the request `www.example.com/1/hello.gif?foo=bar`, `req.url.basename` will 
contain `hello.gif`.
