Best HostGator Web Hosting Plan

Hostgator homepage
  • Unlimited bandwidth
  • Unlimited web hosting space
  • Unlimited addon domains
  • 99.9% uptime guarantee
  • Free site builder & instant setup

To learn more or order, visit HostGator online here!


 

Does Hostgator support .htaccess rewrite?

I knew a few losuy web hosting companies that do not allow their shared hosting users .htaccess overwrite/rewrite.

But not Hostgator.

Dedicated or shared hosting, Hostgator offers full control of .htaccess files to their clients as long as the hosting server is not running on Windows/NT (the file doesn’t work on Windows).

Wind powered

What does a .htaccess file do?

.htaccess files are used in many ways but mainly for personalized error pages, password protection, and website URL redirects.

One of the in-famous usage of .htaccess files is to switch website’s URL between http://www. and http:// (the www and the non www). The function was desperately needed because Google was confused with http://www.example.com and http://example.com as two different pages – they were rating these two URLs with different page rank and for some, it causes serious duplication penalty (as both URL is directed to the index file).

How to rewrite http:// to http://www. with .htaccess?

Well, here’re some simple examples what can .htaccess file does.

Rewrite URL from http:// to http://www

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=permanent,L]

Manage apache handler

AddHandler server-parsed .html
AddHandler server-parsed .htm

To handle a 301 redirect

Redirect 301 /trashpage.html http://www.example.com/redirectpage.htm

Visit Hostgator Online (Hostgator Hosting: $7.95/mo!)

Leave a Comment

Name: (Required)

E-mail: (Required)

Website:

Comment: