5 HTAccess file snippets you should keep handy

1) Make your URLs SEO-friendly and future-proof CODE : <Files ABC> ForceType application/x-httpd-php5 </Files> 2) Apply tag rel=”canonical” to PDFs and images CODE : <Files abc.pdf> Header add Link ‘<http://www.123.co.uk/httest/pdf-abc.html>; rel=”canonical”‘ </Files> <Files xyz.jpg> Header add Link ‘<http://www.123.co.uk/httest/xyz-page.html>; rel=”canonical”‘ </Files> 3) Robots Directive CODE : Header set X-Robots-Tag “noindex, noarchive, nosnippet” … Continue reading