When someone visits your site, the way your URLs look plays a huge role in how they experience your content.
Nobody wants to share links that look like this:
example.com/productdetails.aspx?itemid=2981&catid=90
Instead, you’d want:
example.com/products/asus-vivobook-x515
To make that happen on Windows servers, you need IIS (Internet Information Services) and a powerful built-in tool called the URL Rewrite Module.
But not every hosting environment lets you use this tool. If you’re running your site on Linux shared hosting, you’re out of luck.
You’ll need Windows-based hosting, preferably a VPS that gives you full control.
Let’s break this down step by step.
What is URL rewriting in IIS?
URL rewriting is the process of modifying the structure of URLs on the server side without changing the content that users see. In IIS, this is handled by the URL Rewrite Module, which sits on top of IIS and allows you to define rules that process incoming requests.
When someone requests a URL like:
https://example.com/products/123
Your rewrite rule can silently redirect it to:
https://example.com/productdetails.aspx?id=123
The user doesn’t see the change. The browser URL remains clean. But your app still receives the query in the format it expects.
Why use URL rewriting?
Here’s why it matters:
- SEO-friendly URLs: Search engines prefer readable, keyword-rich URLs.
- Improved UX: Users trust clean URLs more. They’re easier to read, type, and share.
- Backward compatibility: You can support old URL formats after redesigns.
- Security: Hide internal file structures like
.aspxor query strings. - Redirects: Force HTTPS, remove trailing slashes, or redirect to canonical URLs.
How URL rewriting works in IIS
The IIS URL Rewrite Module uses pattern-based rules to inspect incoming URLs. If the pattern matches, it transforms the URL according to your rule and processes it accordingly.
There are two main types of actions:
| Action | What It Does | Example Use Case |
|---|---|---|
| Rewrite | Changes URL path internally, browser sees no change | /products/123 → /product.aspx?id=123 |
| Redirect | Sends browser to a different URL | Redirect http:// to https:// |
Rules are stored in the web.config file or managed via the IIS Manager GUI.
Where the rewrite rules live: web.config
The web.config file is an XML-based configuration file used by ASP.NET applications. The rewrite module reads the rules from this file unless you’re configuring them via the GUI.
Here’s a simple example of a rewrite rule that maps a clean URL to a script:
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Product Rule" stopProcessing="true">
<match url="^products/([0-9]+)$" />
<action type="Rewrite" url="product.aspx?id={R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
<match url>: the regex pattern to match<action>: what to do when the pattern matches{R:1}: the first captured group from the regex
Advanced rules you can set up
You’re not limited to simple rewrites. The module supports:
1) Redirect HTTP to HTTPS
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
2) Remove trailing slashes
<rule name="Remove trailing slash" stopProcessing="true">
<match url="(.*)/$" />
<action type="Redirect" url="{R:1}" redirectType="Permanent" />
</rule>
3) Canonicalize the domain (non-www to www)
<rule name="Redirect to www" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^example\.com$" />
</conditions>
<action type="Redirect" url="https://www.example.com/{R:1}" redirectType="Permanent" />
</rule>
When URL rewriting won’t work
This is where most people get stuck.
If you’re on Linux shared hosting, you’ll be using Apache or LiteSpeed, not IIS. That means you’ll rely on .htaccess and mod_rewrite, which are completely different.
The IIS URL Rewrite Module only works on Windows servers.
And here’s the catch:
- Shared Linux plans do not support IIS
- Most Windows shared hosting plans don’t allow installing modules
- If you need to control your server, you need a Windows VPS
What hosting do you need for IIS rewrite rules?
| Hosting Type | Supports IIS Rewrite? | Access to web.config | Install modules? |
|---|---|---|---|
| Linux shared hosting | ❌ | ❌ | ❌ |
| Windows shared hosting | ✅ (limited) | ✅ | ❌ |
| Windows VPS hosting | ✅ (full) | ✅ | ✅ |
The best option: Windows VPS from Truehost
With Windows VPS hosting from Truehost, you get:
- A Windows Server environment with full IIS access
- RDP access to manage your machine
- Ability to install or upgrade the URL Rewrite Module
- Full control of your
web.config - Support for .NET, MSSQL, and ASP apps
You’re not boxed in by shared hosting limitations. You can write advanced rewrite rules, configure reverse proxies (with ARR), and optimize performance.
Explore available plans on the Windows VPS page — they’re designed for developers and serious projects.
What about Windows shared hosting?
If you’re only planning to run a basic ASP.NET site, and don’t need to install custom modules, then Windows shared hosting may be enough.
Most support
- ASP, ASP.NET
- MSSQL databases
web.configrewrite rules- SSL, email, and Plesk panel
But remember, shared hosting means limited control. If you need to modify IIS settings or troubleshoot complex rewrites, you’re better off with VPS.
Final thoughts
URL Rewrite in IIS is a powerful tool. It helps you clean up your URLs, redirect users, enforce HTTPS, and control how your web app handles requests.
But it only works in the right hosting environment.
If you’re trying to use web.config rewrites on Linux hosting, stop right now — it’s not supported. To access the full capabilities of IIS URL Rewrite, you need a Windows server with admin access.
That’s why a Windows VPS from Truehost is the best choice. It gives you total control, performance, and compatibility.
✅ Ready to rewrite your URLs the right way?
👉 Get started with Windows VPS
Domain SearchInstantly check and register your preferred domain name
Web Hosting
cPanel HostingHosting powered by cPanel (Most user friendly)
KE Domains
Reseller HostingStart your own hosting business without tech hustles
Windows HostingOptimized for Windows-based applications and sites.
Free Domain
Affiliate ProgramEarn commissions by referring customers to our platforms
Free HostingTest our SSD Hosting for free, for life (1GB storage)
Domain TransferMove your domain to us with zero downtime and full control
All DomainsBrowse and register domain extensions from around the world
.Com Domain
WhoisLook up domain ownership, expiry dates, and registrar information
VPS Hosting
Managed VPSNon techy? Opt for fully managed VPS server
Dedicated ServersEnjoy unmatched power and control with your own physical server.
SupportOur support guides cover everything you need to know about our services




