This guide explains how to use CDN URL Rewriter, step by step, with screenshots of the real tool. It is written for site owners who want faster pages and better Core Web Vitals. Rewrite image, CSS and JS URLs in HTML so they load from your CDN domain instead of your main server.
Quick answer: To use the CDN URL Rewriter, open the free tool, paste the input, enter the original domain, enter the CDN domain and tick the also rewrite relative URLs, then copy the text it creates. Everything runs in your browser, so there is no sign up and nothing you type is stored on a server.
On this page

What is the CDN URL Rewriter?
Rewrite image, CSS and JavaScript asset URLs in HTML to a CDN hostname for faster delivery.
Handy for static pages, email templates or when testing a CDN before changing your CMS settings.
How to use CDN URL Rewriter step by step
-
Step 1: Open the CDN URL Rewriter
Go to the CDN URL Rewriter on hasnainsanmal.com. It loads with example values already filled in, so you can see how it works straight away. It works the same way on a phone, tablet or computer.
-
Step 2: Paste Input
Paste or type your text into Input. The example starts with: <img src="https://example.com/wp-content/uploads/a.webp"><link….
-
Step 3: Enter Original domain
In the Original domain box, type your own value. The example uses https://example.com, which you can replace.
-
Step 4: Enter CDN domain
In the CDN domain box, type your own value. The example uses https://cdn.example.com, which you can replace.
-
Step 5: Tick Also rewrite relative URLs
Tick Also rewrite relative URLs if you want this option, or leave it empty to turn it off.
-
Step 6: Read the results
The output appears inside the tool card. Change any input to compare different scenarios.

Screenshot of the CDN URL Rewriter results. -
Step 7: Copy or download the output
Use Copy to take the result into your document, CMS, spreadsheet or report.
What does each field in the CDN URL Rewriter mean?
| Field | What to enter | Example |
|---|---|---|
| Input | Text, one item per line where asked | <img src="https://example.com/wp-content/uploads/a.webp"><link… |
| Original domain | Your text | https://example.com |
| CDN domain | Your text | https://cdn.example.com |
| Also rewrite relative URLs | Tick to turn on | on |
What does a worked example look like?
With the example inputs (Original domain: https://example.com, CDN domain: https://cdn.example.com and Also rewrite relative URLs: on), the CDN URL Rewriter returns: <img src="https://cdn.example.com/wp-content/uploads/a.webp"><link href="https://cdn.example.com/style.css" rel="stylesheet">
Replace the example with your own input to get your own result, then review it before you use it.
How do you get the best results from the CDN URL Rewriter?
- Resize images to the width they are displayed at.
- Test the page again with PageSpeed Insights after changes.
For background, read the Google guide to Core Web Vitals. If you are working on a related task, our guide on how to use the Lazy Load Code Generator walks through it the same way. You can also browse all free Image and Page Speed Tools.
What mistakes should you avoid with the CDN URL Rewriter?
- Compressing images so hard that they look blurry.
- Uploading huge images and letting the browser shrink them.
- Lazy loading the main hero image, which slows Largest Contentful Paint.
Key terms
- WebP
- A modern image format from Google that usually produces smaller files than JPG or PNG at similar quality, and supports transparency. All current browsers support it, which makes it a good default for website images.
- Core Web Vitals
- Google metrics for real user experience: Largest Contentful Paint for loading, Interaction to Next Paint for responsiveness and Cumulative Layout Shift for visual stability. Good thresholds are 2.5 seconds, 200 milliseconds and 0.1.
- HTML
- HyperText Markup Language, the standard language that structures web pages with elements such as headings, paragraphs, links and images. Search engines read the HTML to understand page content, links and metadata.
- Search engine optimisation
- The practice of improving a website so it ranks higher in unpaid search results. It covers technical health, on-page content, links and user experience, and it follows Google Search Essentials rather than shortcuts.
- Browser based tool
- A tool that runs entirely in your web browser with JavaScript, so the data you enter is processed on your own device. It works instantly without sign up, but it cannot fetch other websites because of browser security rules.
Related free tools
Frequently asked questions
Is the CDN URL Rewriter free to use?
Yes. The CDN URL Rewriter is completely free, with no sign up, no daily limit and no watermark. It is one of more than 500 free SEO and marketing tools on hasnainsanmal.com.
Is my data stored when I use the CDN URL Rewriter?
No. The CDN URL Rewriter runs in your browser with JavaScript, so the values and text you enter are processed on your own device and are not sent to or saved on our server.
How accurate is the CDN URL Rewriter?
It creates a solid first draft from your inputs. Always review and edit the output so it is accurate, specific and sounds like you before you publish or send it.
Does the CDN URL Rewriter work on a phone?
Yes. The tool is built for screens from 360 pixels wide, so you can use the CDN URL Rewriter on a phone, tablet or computer in any modern browser.
Can I use the CDN URL Rewriter for client work?
Yes. You can use the results for your own sites and for client projects. Check the output first, and keep a note of the inputs you used so you can repeat the check later.
What should I do after using the CDN URL Rewriter?
Apply the result on your page, campaign or document, then measure the effect. If you would like expert help, see the SEO services or message Hasnain on WhatsApp for a free recommendation.
How we checked this guide: every step and screenshot was taken from the live CDN URL Rewriter on 2 November 2026. Further reading: Google image SEO best practices.




