Skip to content

Instantly share code, notes, and snippets.

View weeksdev's full-sized avatar
🏠
Working from home

Andrew Weeks weeksdev

🏠
Working from home
View GitHub Profile
@weeksdev
weeksdev / gist:106d6e18ce5f60097c9e
Last active August 29, 2015 14:27 — forked from cmandersen/gist:91d840db222c3df543c2
Setup nginx to redirect Google's _escaped_fragment_= request to a snapshots folder
# This should be inserted into the server {...} block.
# These lines rewrite the url to access the snapshots folder, or where ever you keep
# you prerendered pages (mainly used when working with pages rendered by JavaScript).
#
# example.com/?_escaped_fragment_= --> example.com/snapshots/index.html
# example.com/?_escaped_fragment_=/blog --> example.com/snapshots/blog.html
# example.com/?_escaped_fragment_=/blog/post --> example.com/snapshots/blog/post.html
# Captures URLs with any amount of levels (?_escaped_fragment_=/.../...)