Skip to main content

htaccess

Redirecting www To non-www And Vice Versa

Note: This post was written in 2012. The .htaccess rules below still work on Apache servers, but modern setups (NGINX, Caddy, Apache 2.4 with virtual hosts) handle redirects differently. The rules also use http:// — update them to https:// for any SSL-enabled site. Every domain can be accessed through two different URLs. Take example.com — it's reachable as both example.com and www.example.com. The same applies to subdomains. From a user's point of view this doesn't matter much, but from an SEO standpoint it's a problem. Having the same content available on two different URLs can be flagged as duplicate content and hurt your search rankings.

AddHandler vs AddType : Apache Directive

AddHandler and AddTypes are two directives which define how file should be treated by apache. AddType defines how a client (example A web browser) should deal with the file or data stream, while AddHandler defines how a server should parse a file. Read this post for more information on them.