A Chrome extension for redirecting requests from one URL prefix to another.
It is designed for local development scenarios where you want a page to keep making requests to a production or integration-style endpoint, but have those requests transparently redirected to a different backend such as https://localhost.
- Redirects requests when the request URL starts with a configured match prefix.
- Replaces that prefix with a configured target prefix.
- Supports enabling, disabling, and removing rules from the options page.
- Ships with a default example rule on first install:
- From:
https://devint.eu.peoplefirst-dev.com/api/v1/customcards/ - To:
https://localhost:8301/api/customcards/
- From:
You can get the extension source in either of these ways:
If this project is hosted on GitHub:
- Open the repository page.
- Select Code.
- Select Download ZIP.
- Extract the ZIP to a folder on your computer.
git clone <repository-url>After cloning, the extension folder should contain files such as manifest.json, service_worker.js, content_script.js, and options.html.
- Open Chrome.
- Go to
chrome://extensions. - Turn on Developer mode in the top-right corner.
- Select Load unpacked.
- Choose the extracted project folder:
- the folder that contains
manifest.json
- the folder that contains
- The extension should now appear in your installed extensions list as API URL Redirector.
After loading the extension:
- Go to
chrome://extensions. - Find API URL Redirector.
- Select Details.
- Select Extension options.
This opens the options page where you can manage redirect rules.
On the options page:
- In Match prefix (From), enter the beginning of the URL you want to intercept.
- In Replace prefix (To), enter the new base URL.
- Select Add.
Example:
- From:
https://devint.eu.peoplefirst-dev.com/api/v1/customcards/ - To:
https://localhost:8301/api/customcards/
With that rule in place, a request like:
https://devint.eu.peoplefirst-dev.com/api/v1/customcards/items/123
is redirected to:
https://localhost:8301/api/customcards/items/123
In Current Rules, each rule can be:
- Disabled temporarily using the toggle button
- Enabled again later
- Removed completely
- Start your local API.
- Load this extension in Chrome.
- Add a rule that maps the remote API prefix to your local API prefix.
- Open the web app you want to test.
- Use the app normally; matching requests will be redirected.
- The extension uses Developer mode / Load unpacked, so it is intended for local or internal use unless you package and publish it separately.
- Use the folder containing
manifest.jsonwhen loading the extension. - If your local backend uses HTTPS, make sure your local certificate is trusted by Chrome.
- Your local backend must still handle any required CORS, auth, or API behavior expected by the page.
- Make sure you selected the correct folder.
- Confirm that
manifest.jsonis directly inside the selected folder. - Check
chrome://extensionsfor any load errors.
- Confirm the rule is enabled.
- Make sure the request URL starts with the exact Match prefix.
- Reload the target page after changing rules.
- Open Chrome DevTools and inspect the Network tab to confirm the actual request URL.
- Make sure your local server is running.
- Verify the replacement URL is correct.
- If using
https://localhost, confirm the certificate is valid/trusted.
manifest.json— extension manifestoptions.html/options.js— settings UI for managing rulesservice_worker.js— background logic and stored rulescontent_script.js— sends rules into the page contextpage_interceptor.js— intercepts matching requests in the page