Created
October 28, 2013 10:18
-
-
Save wonglok/7194458 to your computer and use it in GitHub Desktop.
This file contains 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 | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule .* index.html [L] | |
<IfModule mod_proxy_http.c> | |
# 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} !PhantomJS | |
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