Getting Started
Getting Started
Installation
Installation
Inspect Traffic
Inspect Traffic
HTTP Rules (Modify Traffic)
HTTP Rules (Modify Traffic)
Overview
Request Modification — Redirect URL (Map Local, Map Remote)
Request Modification — Replace Strings (Switch Hosts, API Endpoints)
Request Modification — Modify Headers
Request Modification — Modify Request Body
Response Modification — Modify Response Body
Request Modification — Modify Query Params
Request Modification — Modify User Agents
Request Modification — Delay Request
Request Modification — Map Local
Request Modification — Map Remote
Response Modification — Modify DOM/Inject scripts
Response Modification — Cancel Rule
Predefined Functions
Organizing Rule — Grouping
Organizing Rule — Import/Export Rules from File
Organizing Rule — Pause/Resume Requestly
Organizing Rule — Rule Operators
Organizing Rule — Advance Targeting
Organizing Rule — Sharing Rules
Organizing Rule — Pinning Rules
GraphQL - Modify Request & Response
Import / Export — Charles Proxy Rules
Test Rules — Test URL Condition
Test Rules — Test this Rule
Session Book
Session Book
File Server
File Server
Public API
Public API
FAQ
FAQ
Guides
Guides
TroubleShooting
TroubleShooting
Subscription & Billing
Subscription & Billing
Getting Started
Getting Started
Installation
Installation
Inspect Traffic
Inspect Traffic
HTTP Rules (Modify Traffic)
HTTP Rules (Modify Traffic)
Overview
Request Modification — Redirect URL (Map Local, Map Remote)
Request Modification — Replace Strings (Switch Hosts, API Endpoints)
Request Modification — Modify Headers
Request Modification — Modify Request Body
Response Modification — Modify Response Body
Request Modification — Modify Query Params
Response Modification — Modify DOM/Inject scripts
Request Modification — Modify User Agents
Request Modification — Delay Request
Response Modification — Cancel Rule
Organizing Rule — Grouping
Organizing Rule — Import/Export Rules from File
Organizing Rule — Pause/Resume Requestly
Organizing Rule — Rule Operators
Organizing Rule — Advance Targeting
Organizing Rule — Sharing Rules
Request Modification — Map Local
Request Modification — Map Remote
Organizing Rule — Pinning Rules
GraphQL - Modify Request & Response
Import / Export — Charles Proxy Rules
Test Rules — Test URL Condition
Predefined Functions
Test Rules — Test this Rule
File Server
File Server
Public API
Public API
Sessions Replay
Sessions Replay
Guides
Guides
Session Book
Session Book
Subscription & Billing
Subscription & Billing
Map Remote
The Map Remote feature lets you change the request's location to a new destination location such that the response is transparently served from the new location as if it was the original request.
How to use
You can use Redirect/Replace rule to set up mappings.
- Redirect rule allows you to redirect network requests from one URL to another.
- Replace rule allows you to replace a part of the URL with another string.
You can check out the demo here:
Matching Requests
All the Requestly rules can match requests based on the URL, host, path, and rule operators. With the help of these operators, you can define rules to match using the wildcard, regex, or string matching types. You can also perform advanced targeting on the requests.
You can perform regex pattern matching in replace rule to extract information from the URL:
For example: Extract domain, pathName and extension for URLs ending with
.jpg
/(https:\/\/[^\/]*)(.+)(\.jpg)$/i
- $1 is the value of 1st group expression. – DomainName
- $2 is the value of the 2nd group expression – PathName but not the file extension
- $3 is the value of the 3rd group expression – File extension
.jpg
in this case
Similar Examples
Map local resources on the production site
You can find the above redirect rule here.
Switch domain to staging environment using replace rule
You can find the above replace the rule here.
Popular Use Cases
- Use development/staging endpoints on your production sites without changing the code so that you can directly test your local code on production sites without deployment.
- You can switch your domain to a local environment for testing new changes that are yet to be deployed.
- You can map HTTP requests to an HTTPS destination and vice versa.
- You can test the backward compatibility of a new API by mapping all requests to the more recent version of the API.