Skip to content

Instantly share code, notes, and snippets.

@thoop
thoop / gist:6be274259bdeee4e2363e008577bff2a
Last active December 27, 2019 05:25
Prerender.io IIS web.config
<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<!--# Only proxy the request to Prerender if it's a request for HTML-->
<rule name="Prerender" stopProcessing="true">
<serverVariables>
<set name="HTTP_X_PRERENDER_TOKEN" value="[...your token...]" />
</serverVariables>
@thoop
thoop / gist:3d3589171f2bb01d29237d0d49961d5f
Last active December 22, 2019 18:32
new nginx.conf with map
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
# Generate $prerender_ua bool value based on user agent
# indexation bots will get this as 1,
# prerender user agent will always get 0 (avoid loops)
map $http_user_agent $prerender_ua {
default 0;
@thoop
thoop / nginx.conf
Last active November 12, 2024 19:08
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@thoop
thoop / .htaccess
Last active November 13, 2024 20:20
Official prerender.io .htaccess for Apache.
# Change YOUR_TOKEN to your prerender token
# Change http://example.com (at the end of the last RewriteRule) to your website url
<IfModule mod_headers.c>
RequestHeader set X-Prerender-Token "YOUR_TOKEN"
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On