Last active
August 29, 2015 14:08
-
-
Save freekrai/6ef4ca80d015fb24b41c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase /prerender-test/ | |
# Virtual/pushState URIs (requests not matching an existing file get forwarded to index.html) | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule .* index.html [L] | |
<IfModule mod_proxy_http.c> | |
# Enable prerendering for .html and directory index files | |
RewriteCond %{HTTP_USER_AGENT} googlebot|yahoo|bingbot|baiduspider [NC,OR] | |
RewriteCond %{QUERY_STRING} _escaped_fragment_|prerender=1 | |
RewriteCond %{HTTP_USER_AGENT} !^Prerender | |
RewriteRule ^(.*\.html)?$ http://prerender.herokuapp.com/http://www.yourdomain.com/prerender-test/$1 [P,L] | |
</IfModule> | |
</IfModule> | |
# Optionally add a ProxyPassReverse directive to ensure that 301/302 redirects | |
# issued by the prerender service are correctly forwarded to the client. | |
# Note that this must be located in your Apache config rather than .htaccess | |
# <IfModule mod_proxy_http.c> | |
# ProxyPassReverse /prerender-test/ http://prerender.herokuapp.com/http://www.yourdomain.com/prerender-test/ | |
# </IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment