Skip to content

Instantly share code, notes, and snippets.

@rahul-desai3
Created May 21, 2015 05:03
Show Gist options
  • Save rahul-desai3/c164129ddd7da6aa758b to your computer and use it in GitHub Desktop.
Save rahul-desai3/c164129ddd7da6aa758b to your computer and use it in GitHub Desktop.
# Prerender configuration:
<IfModule mod_headers.c>
RequestHeader set X-Prerender-Token "EXTPYjaUpb3wwCWrJHwt"
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
<IfModule mod_proxy_http.c>
RewriteCond %{HTTP_USER_AGENT} baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest|slackbot|vkShare|W3C_Validator [NC,OR]
RewriteCond %{QUERY_STRING} _escaped_fragment_
# Only proxy the request to Prerender if it's a request for HTML
RewriteRule ^(?!.*?(\.js|\.css|\.xml|\.less|\.png|\.jpg|\.jpeg|\.gif|\.pdf|\.doc|\.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))(.*) http://service.prerender.io/http://cordbloodbanking.com/$2 [P,L]
</IfModule>
</IfModule>
# do not allow anyone else to read your .htaccess file
<Files .htaccess>
deny from all
</Files>
# forbid viewing of directories
Options All -Indexes
# hide this list of files from being seen when listing a directory
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
# disable the server signature- helps with preformance
ServerSignature Off
RewriteEngine On
RewriteBase /
# hide /index
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index($|\ |\?)
RewriteRule ^ /%1/ [R=301,L,NE]
# add trailing /
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^[^.]+$ %{REQUEST_URI}/ [L,R=301,NE]
# specific rule to show 1 URL but other URL is active
RewriteCond %{DOCUMENT_ROOT}/$1\.html -f [NC]
RewriteRule ^([^/]+) $1.html [L]
# add WWW prefix
RewriteCond %{HTTP_HOST} !^(www|max)\.cordbloodbanking\.com$ [NC]
RewriteRule ^ http://www.cordbloodbanking.com%{REQUEST_URI} [R=301,L]
# Accordian pages redirects
# stem-cells section redirects
Redirect /stem-cells/types /cord-blood/types
Redirect /stem-cells/sources /cord-blood/sources
Redirect /stem-cells/hla-matching /cord-blood/hla-matching
Redirect /stem-cells/allogenic-transplants /cord-blood/allogenic-transplants
Redirect /stem-cells/autologous-transplants /cord-blood/autologous-transplants
Redirect /stem-cells/syngeneic-transplants /cord-blood/syngeneic-transplants
# private-banking section redirects
Redirect /private-banking /cord-blood/private-banking
Redirect /private-banking/choosing-a-bank /cord-blood/choosing-a-bank
Redirect /private-banking/costs /cord-blood/costs
# public-banking section redirects
Redirect /public-banking /cord-blood/public-banking
Redirect /public-banking/requirements /cord-blood/requirements
# Accordian pages redirects
Redirect /diseases-treated /research/diseases-treated
Redirect /lymphoma /research/lymphoma
Redirect /leukemia /research/leukemia
Redirect /anemia /research/anemia
Redirect /autoimmune-diseases /research/autoimmune-diseases
Redirect /clinical-trials /research/clinical-trials
Redirect /brain-damage /research/brain-damage
Redirect /cerebral-palsy /research/cerebral-palsy
Redirect /multiple-sclerosis /research/multiple-sclerosis
Redirect /heart-failure /research/heart-failure
Redirect /autism /research/autism
Redirect /osteoarthritis /research/osteoarthritis
Redirect /rheumatoid-arthritis /research/rheumatoid-arthritis
Redirect /spinal-cord-injury /research/spinal-cord-injury
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment