Andrew McCombe

Full Stack Web Developer

Apache: Use .htaccess to redirect non-www to www

Sometimes your website will be set up to serve your site on both and also Search engines will see this as two separate sites (unless you have a rel=”canonical” tag) and this may have a negative effect on your SEO rankings. The best way to avoid this is to make sure you serve […]

Apache: Use .htaccess to redirect http to https

I’m forever having to lookup how to use Apache’s .htaccess to redirect http to https so here it is. First, make sure you have Apache’s mod_rewrite module enabled. # Redirect non-https requests to https RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$$1 [L,R=301] This will check the request for HTTPS and if it matches will […]