How to change a part in the URL (e.g. domain) while keeping the rest of the URL same?

Your lightweight Client for API debugging
No Login Required
Requestly is a web proxy that requires a desktop and desktop browser.
Enter your email below to receive the download link. Give it a try next time youâre on your PC!
Requestly’s Replace String rule allows users to replace a string (or matching pattern) with another string in the url. It looks to be very simple but it can achieve very complex use cases:
- Switching Domains
- Change Query Parameter Values
- Fix broken/updated URLs
- Pattern Matching in Replace Rule
Using Requestly to change the domain of the URL
In this example we will change the domain of the url https://stackexchange.com with stackoverflow.
- Download and Install the Requestly Chrome extension.
- Click on
Create your first rule. - Then select
Replace Stringand click onCreate rule. - We’ll be replacing the substring
exchangewithoverflow. Enterexchangein the Replace field andoverflowin the With field. - Save the rule.

On opening stackexchange.com, this rule will replace the exchange substring with overflow and will load the webpage for stackoverflow.com.
You can try it yourself by importing this rule , also fiddle around and replace different substrings of the URL.
Contents
Subscribe for latest updates
Share this article
Related posts
Get started today
Requestly is a web proxy that requires a desktop and desktop browser.
Enter your email below to receive the download link. Give it a try next time youâre on your PC!










