308 Permanent Redirect HTTP status code.
Overview
This responder is useful when you want to send blocked clients to an alternative location instead of showing an error or blocking them outright. The redirect uses HTTP 308, which preserves the request method and body.Configuration
The destination URL to redirect clients to.This field is required when using the Redirect responder.Must be a valid URL (absolute or relative).
IP ranges to redirect. Can be CIDR notations or predefined service keys.Default:
["aws", "azurepubliccloud", "deepseek", "gcloud", "githubcopilot", "openai"]Optional list of specific IP addresses to exclude from redirection.Default:
[]HTTP Response
308 Permanent Redirect
The configured destination URL
Examples
Implementation Details
The Redirect responder is implemented inresponders/redirect.go:14:
http.Redirect function with http.StatusPermanentRedirect (308).
HTTP 308 vs Other Redirect Codes
| Code | Name | Method Preserved | Cache Behavior |
|---|---|---|---|
| 301 | Moved Permanently | No (GET/HEAD only) | Cached by browsers |
| 302 | Found | No (GET/HEAD only) | Not cached |
| 307 | Temporary Redirect | Yes | Not cached |
| 308 | Permanent Redirect | Yes | Cached by browsers |
- Preserve POST/PUT/DELETE methods if used
- Signal to crawlers this is permanent
- Allow browser caching of the redirect
Use Cases
Redirect to API Documentation
Send AI scrapers to your API documentation instead of blocking:Redirect to Contact Form
Direct potential partners to a contact form:Redirect to Information Page
Provide information about why access is restricted:Redirect to Alternative Content
Send scrapers to a different version of your site:Redirect URL Options
Absolute URLs
Relative URLs
URLs with Query Parameters
Client Behavior
How different clients handle 308 redirects:- Browsers
- curl
- HTTP Libraries
- Automatically follow the redirect
- Cache the redirect (future requests go directly to new URL)
- Preserve request method (POST stays POST)
Advantages
- Informative - Can direct users to explanation pages
- Professional - More polite than blocking or dropping
- Flexible - Can redirect anywhere (docs, contact, etc.)
- SEO-friendly - Search engines understand 308 redirects
- Preserves method - POST/PUT/DELETE preserved unlike 301/302
Disadvantages
- Scrapers still consume resources - They still hit your server first
- May be followed - Sophisticated scrapers will follow redirects
- Requires destination - Need to maintain the redirect target
- Cached by browsers - Hard to change later for same clients
Comparison with Other Responders
- vs Block: Redirect sends users elsewhere, Block denies access
- vs Custom: Redirect changes location, Custom shows a message
- vs Drop: Redirect gives direction, Drop gives nothing
- vs Tarpit: Redirect is immediate, Tarpit deliberately slows down
When to Use Redirect
Use Redirect when:- You want to provide alternative resources
- Directing scrapers to API docs is preferred
- Professional, polite blocking is desired
- You have a good destination URL
- You want to minimize all scraper interaction
- The destination doesn’t add value
- Bandwidth conservation is critical
- You want to hide that blocking is happening
Best Practices
- Redirect to useful content - API docs, contact forms, policy pages
- Use HTTPS URLs - Ensure redirect destination is secure
- Monitor redirect destination - Ensure target URL stays valid
- Consider redirect loops - Don’t create circular redirects
- Test redirect behavior - Verify clients are redirected correctly
Testing
Test the Redirect responder:Advanced Configuration
Different Redirects for Different Ranges
Redirect with Whitelist
Related Documentation
- Custom Responder - Return a message instead of redirecting
- Block Responder - Block access with 403
- HTTP 308 Status Code - MDN Documentation