How to Force SSL (https) Using .htaccess


The Secure Socket Layer (SSL) is a way to encrypt data to keep it safe while it moves across an insecure network. Its successor, Transport Layer Security (TLS) is backward compatible, so implementing SSL means a client or server using TLS can still establish a secure connection. Many web sites still use SSL with no problems.

Continue reading How to Force SSL (https) Using .htaccess

How to Create 301 Redirects Using .htaccess

How to Create 301 Redirects Using .htaccess

Websites are every changing. Sometimes a resource moves, and users need to be redirected from the old page to the new one. Sometimes websites merge, also requiring a redirect. Sometimes a webmaster owns several domain name variants (.com/.org/.net and so forth) and needs to redirect from the subsidiary ones to the canonical site.

Continue reading How to Create 301 Redirects Using .htaccess

Setting Your Directory Index With .htaccess

How to Set Your Directory Index With .htaccess

A good habit to develop is setting your directory index, or homepage, using .htaccess. True, the directory’s default file is already set, the server default “index.(extension).” Generally speaking, Apache uses a default setting of “index.html” or “index.php”. However, this can lead to problems, particularly when dealing with shared hosting. In some cases, the host will change the guidelines, which leaves you to go through and make the appropriate alterations to prevent any issues. But, by setting your own directory index, you avoid the problem completely.

Continue reading Setting Your Directory Index With .htaccess

How to Remove “www” Using .htaccess


When the web was young everyone got accustomed to typing “www” to complete a web address or URL. But, now the “www” isn’t necessary and many website owners remove this portion of their site URL for a variety of reasons. Among them are the undeniable benefits.

  • Shorter/cleaner URLs are easier to remember
  • By removing the “www” the site uses less bandwidth.
  • Site owners do not have to worry about Google search engine penalties because of possible duplicate content.

Continue reading How to Remove “www” Using .htaccess