Need integration help? Contact our engineering team
Please choose the option as per your server configuration from the side menu and follow the instructions

Apache Integration Guide

Integrate Index Render with your Apache web server using mod_rewrite and mod_proxy. This setup automatically detects search engine bots and serves them pre-rendered HTML while remaining completely transparent to real users.

Server-Side Proxying Using Apache to handle bot traffic ensures that your application backend remains unburdened by heavy crawler requests, leading to better overall site performance.
1

Enable Required Modules

Ensure that the following Apache modules are enabled. These are necessary for URL rewriting and proxying requests to the Index Render API.

Terminal
sudo a2enmod rewrite
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod headers
sudo systemctl restart apache2
2

Configure Redirect Logic

Add the following configuration to your .htaccess file or your VirtualHost configuration block. This logic identifies bots by their User-Agent and proxies them to the pre-rendering service.

.htaccess / virtualhost
<IfModule mod_rewrite.c>
  RewriteEngine On

  # 1. Detect search engine crawlers and AI bots
  RewriteCond %{HTTP_USER_AGENT} (googlebot|googlebot-image|googlebot-video|googlebot-news|googleother|apis-google|bingbot|yandex|baiduspider|facebookexternalhit|facebookcatalog|facebot|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest|pinterestbot|slackbot|slack-imgproxy|vkshare|w3c_validator|redditbot|applebot|whatsapp|flipboard|tumblr|bitlybot|skypeuripreview|nuzzel|discordbot|google\ page\ speed|qwantify|bitrix\ link\ preview|xing-contenttabreceiver|telegrambot|google-inspectiontool|petalbot|duckduckbot|bytespider|gptbot|chatgpt-user|claudebot|perplexitybot|ahrefsbot|semrushbot|mj12bot|slurp) [NC]
  
  # 2. Skip IndexRender's own renderer to avoid loops
  RewriteCond %{HTTP_USER_AGENT} !IndexRender [NC]

  # 3. Exclude static assets from being pre-rendered
  RewriteCond %{REQUEST_URI} !\.(js|css|xml|less|png|jpg|jpeg|gif|pdf|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|woff2|svg|eot)$ [NC]

  # 4. Proxy the request to the Index Render API
  # Ensure you replace 'your_api_key_here' with your actual API key
  RequestHeader set x-indexrender-key "your_api_key_here"
  RequestHeader set Accept "text/html"
  
  RewriteRule ^(.*)$ https://api.indexrender.io/api/v1/render?url=%{REQUEST_SCHEME}://%{HTTP_HOST}%{REQUEST_URI} [P,L]
</IfModule>
3

Verify Integration

To confirm that your integration is active, send a request to your URL while simulating a search engine bot. Run the following command in your terminal:

Terminal
curl --location 'https://yourdomain.com' \
--header 'User-Agent: googlebot'

In the <head> section of the response, you should see the Index Render metadata tags indicating the page was successfully pre-rendered:

Expected Output
<!--IndexRender-->
<meta name="generator" content="IndexRender/65d6cde" />
<meta name="x-rendered-by" content="IndexRender/65d6cde" />
<meta name="x-rendered-at" content="2026-04-26T18:26:03.1076251Z" />
<meta name="x-render-traceparent" content="00-39f1dd04eeba1243cae01dc5c70e5b47-cdf5cfae992740d8-01" />