File: //old_home_backup/diabeteschallenge.org.uk/public_html/.htaccess
# invoke rewrite engine
RewriteEngine On
RewriteBase /
# Redirect to www
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
#Redirect 400,401,403,404,500 to main website
ErrorDocument 400 http://health-news.co.uk
ErrorDocument 401 http://health-news.co.uk
ErrorDocument 403 http://health-news.co.uk
ErrorDocument 404 http://health-news.co.uk
ErrorDocument 500 http://health-news.co.uk
# redirect all extension to html
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.shtml$ $1.html [nc]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.phtml$ $1.html [nc]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.htm$ $1.html [nc]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.php$ $1.html [nc]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.aspx$ $1.html [nc]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.asp$ $1.html [nc]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^(.*)\.jsp$ $1.html [nc]
# Add a trailing slash (/) to a URL, if the URL did not have a trailing slash before
RewriteRule ^([^.]*[^/])$ /$1/ [L,R=301]
RewriteRule ^index.html$ / [L,R=301]
RewriteRule ^Child\-and\-Teen\-Health\/Child\-&\-Teen\-Health\.php.html$ Child-and-Teen-Health/Child-_-Teen-Health.html [L,R=301]
RewriteRule ^Employment\-and\-Professions\/Employment\-&\-Professions\.php.html$ Employment-and-Professions/Employment-_-Professions.html [L,R=301]
RewriteRule ^Health\-Conditions\/Women's\-Health\.php.html$ Health-Conditions/Women_s-Health.html [L,R=301]
RewriteRule ^Pharmacy\-and\-Products\/Pharmacy\-&\-Products\.php.html$ Pharmacy-and-Products/Pharmacy-_-Products.html [L,R=301]
RewriteRule ^Reproductive\-and\-Sexual\/Reproductive\-&\-Sexual\.php.html$ Reproductive-and-Sexual/Reproductive-_-Sexual.html [L,R=301]
RewriteRule ^News\-and\-Resources\/News\-&\-Resources\.php.html$ News-and-Resources/News-_-Resources.html [L,R=301]