Skip to content
  • There are no suggestions because the search field is empty.

How do I integrate Prerender.io with IIS?

Connect Prerender.io to your IIS server using URL rewrite rules so AI crawlers and search engines receive fully rendered HTML, with no middleware installation required.

TL;DR

To integrate Prerender.io with IIS, you configure URL rewrite rules that detect crawler requests by User-Agent and forward them to Prerender.io's rendering service. No middleware is needed. The setup requires the Microsoft URL Rewrite module and Application Request Routing (ARR) on your IIS server.


⚠️ Azure App Services users: The Azure App Services URL rewrite rules do not support custom domain forwarding. Follow the dedicated Azure IIS integration guide instead of this guide.

ℹ️ Prefer a video walkthrough? A video guide below for this integration is available. 

 


Step 1: create a Prerender.io account and copy your token.

If you do not have a Prerender.io account yet, sign up at prerender.io.

Once logged in, go to Security & Access in your Prerender.io dashboard and copy your Prerender.io token. You will need it in Step 4.


Step 2: install the required IIS modules.

Your IIS server needs two Microsoft modules installed before you can configure the rewrite rules:

Download and install both from the IIS official downloads page. If they are already installed on your server, skip to Step 3.


Step 3: enable the ARR proxy in IIS Manager.

ARR is installed but disabled by default. Enable the proxy before creating your rewrite rules.

  1. Open IIS Manager.
  2. Select your server from the Connections panel.
  3. Double-click Application Request Routing Cache.
  4. Click Server Proxy Settings in the right-side Actions menu.
  5. Check Enable proxy, then click Apply.

Step 4: add your Prerender.io token as a server variable.

IIS passes the token to Prerender.io via an HTTP request header. You define this as a server variable in the URL Rewrite module.

  1. In IIS Manager, go to Sites > Your Site > URL Rewrite.
  2. Under the Server Variables section, add a new variable:
    • Name: HTTP_X_PRERENDER_TOKEN
    • Value: YOUR_TOKEN (replace with the token you copied in Step 1)
    • Check Replace the existing value.

Step 5: create the URL rewrite rule.

This rule tells IIS which requests to forward to Prerender.io. Requests from known AI crawlers and search engine bots are forwarded. Requests for static files and requests from website visitors are not.

  1. In URL Rewrite, click Add Rules…, then choose Blank Rule.
  2. Name the rule (e.g., Prerender.io Rewrite Rule).
  3. In the Match URL section, set:
    • Requested URL: Does Not Match the Pattern
    • Using: Regular Expressions
    • Pattern: paste the following:
(\.js|\.json|\.css|\.xml|\.less|\.png|\.jpg|\.jpeg|\.gif|\.pdf|\.doc|\.txt|\.ico|\.rss|\.zip|\.mp3|\.rar|\.exe|\.wmv|\.doc|\.avi|\.ppt|\.mpg|\.mpeg|\.tif|\.wav|\.mov|\.psd|\.ai|\.xls|\.mp4|\.m4a|\.swf|\.dat|\.dmg|\.iso|\.flv|\.m4v|\.torrent|\.ttf|\.woff|\.svg)
 
  • Check Ignore case if your site URLs are case-insensitive.

4. Add two Conditions and set Logical Grouping to Match Any: Condition 1: match crawler User-Agents

  • Condition Input: {HTTP_USER_AGENT}
  • Pattern: paste the following:
googlebot|adsbot-google|apis-google|mediapartners-google|google-safety|feedfetcher-google|googleproducer|google-site-verification|bingbot|yandexbot|yabrowser|yahoo|baiduspider|naver|seznambot|sznprohlizec|qwantbot|ecosia|duckduckbot|duckassistbot|applebot|facebookexternalhit|facebookcatalog|facebookbot|meta-externalagent|instagram|twitterbot|linkedinbot|whatsapp|slackbot|pinterest|pinterestbot|tiktok|tiktokspider|bytespider|discordbot|semrushbot|ahrefsbot|chrome-lighthouse|screaming-frog|oncrawlbot|botifybot|deepcrawl|lumar|rogerbot|dotbot|gptbot|chatgpt|oai-searchbot|chatgpt-user|claudebot|google-extended|perplexitybot|perplexity-user|youbot|amazonbot|anthropic-ai|claude-web|ccbot|mistralai-user|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest/0\.|vkShare|W3C_Validator|redditbot|flipboard|tumblr|bitlybot|skypeuripreview|nuzzel|google\ page\ speed|qwantify|bitrix\ link\ preview|xing-contenttabreceiver|google-inspectiontool|telegrambot
  • Check Ignore case.

Condition 2: match escaped fragment URLs

  • Condition Input: {QUERY_STRING}
  • Pattern: _escaped_fragment_
 

Step 6: set the action to forward crawler requests.

With the rule conditions in place, tell IIS where to forward matching requests.

  1. Set Action Type to Rewrite.
  2. Set the Rewrite URL to:
https://service.prerender.io/https://{HTTP_HOST}/{REQUEST_URI}

      3.  Uncheck Append query string.

      4.  Optionally enable Log rewritten URL and Stop processing of subsequent rules for easier debugging.

ℹ️ Special characters in URLs: If your application uses special characters in URLs, use {UNENCODED_URL} instead of {REQUEST_URI} in the Rewrite URL above. You also need to set useOriginalURLEncoding to false in your IIS Configuration Editor.

ℹ️ Local or dev environments: This guide assumes your IIS server is publicly accessible from the internet. For local testing, replace https://service.prerender.io with your local Prerender.io open-source instance (e.g., http://localhost:3000). See the Prerender open-source project on GitHub.


Step 7: verify your integration is working.

Before going further, confirm that Prerender.io is correctly intercepting crawler requests and serving rendered HTML.

➡️ See How to verify your Prerender.io integration is working for step-by-step instructions.

✅ Your integration is working when cached pages appear in your Prerender.io dashboard within 2 to 5 minutes of your first crawler request, and a simulated Googlebot request to your site returns a fully rendered HTML response served by Prerender.io.

ℹ️ If verification fails, check that:

  • The ARR proxy is enabled (Step 3).
  • Your token is correctly set as a server variable (Step 4).
  • The User-Agent pattern in Condition 1 includes the bot you are testing with.

Related articles


 

💬 Still need help? If you have questions about your IIS integration or are seeing unexpected behavior with your rewrite rules, our support team can help. → Contact us at support@prerender.io

Was this article helpful?