Skip to main content

What is a Request Path?

The request path is the part of the URL after your domain name that identifies which resource or page is being accessed.
MDN Web DocsRead more on URL pathname.

Understanding URL Structure

The request path is /shop/products/shoes - everything between the domain and the query parameters.

Common Path Patterns

Application Areas

  • /admin/* - Administrative interfaces
  • /api/* - API endpoints
  • /auth/* - Authentication flows
  • /user/* - User profiles and settings
  • /checkout/* - Purchase flows

Sensitive Endpoints

  • /login - Authentication entry
  • /reset-password - Account recovery
  • /api/internal - Internal APIs
  • /debug - Debug endpoints (should be disabled in production!)
  • /.git - Version control (should never be exposed!)

How Paths Work on the Web

Different types of applications use paths differently:
  • Traditional websites: Each path is a different page (/about, /contact)
  • REST APIs: Paths represent resources (/api/users/123)
  • Single-page apps: May use one path with client routing (/app/*)
  • Static sites: Paths map to actual files (/images/logo.png)

Using Request Path in Policies

Basic Examples

Protect admin area:
Monitor API usage:

Advanced Patterns

Detect path traversal attempts:
Rate limit specific endpoints:
Pro TipUse “starts with” for broad protection, “equals” for specific endpoints, and “contains” for pattern detection.

Path Matching Operators

Best Practices

DO:

  • Use specific paths for sensitive areas - Be precise with admin/internal paths
  • Consider URL patterns - Your app might use /user/123 style paths
  • Monitor before blocking - Understand traffic patterns first
  • Account for variations - /admin and /admin/ might both exist
  • Think about path hierarchy - Protecting /api also protects /api/users

DON’T:

  • Use overly broad patterns - Blocking all paths with “user” might break legitimate features
  • Forget about case sensitivity - /Admin might differ from /admin
  • Ignore trailing slashes - They can make a difference
  • Block common paths carelessly - / or /api might be too broad

Common Attack Patterns

Dynamic Paths and Wildcards

Many applications use dynamic path segments:
Working with Dynamic SegmentsFor paths like /product/123/reviews, you might want to:
  1. Protect all products: starts with /product
  2. Specific product: starts with /product/123
  3. All reviews: contains /reviews

Combining with Other Fields

Request Path becomes more powerful when combined with:

Troubleshooting

“My path policy isn’t matching”
  • Check for trailing slashes
  • Verify URL encoding (%20 for spaces)
  • Confirm the exact path in your server logs
  • Remember query parameters are not part of the path
“I’m blocking legitimate users”
  • Your pattern might be too broad
  • Check for unexpected path variations in your app
  • Consider using Challenge instead of Block initially