Create a .htaccess file

You can create a .htaccess file on your local computer or on the server.

On your computer:

Windows: Using Notepad save the file as .htaccess 

Mac OS X: Using TextEdit save the file as ".htaccess" 
Note: If you save the file as .htaccess it will be hidden and you will not be able to see it in the Finder.

Using your preferred FTP client upload the file to the server. The .htaccess file will need to be in the folder where your site is located, typically the public_html folder.

On the server

  1. Login to your cPanel Account
  2. Click the File Manager icon, located in the Files section.
  3. From the File Manager popup choose "Choose Hidden Files (dotfiles)." 
    Note: If you do not see this popup you will need to click the "reset all interface settings" link at the bottom of the cPanel page.
  4. From the File Manager popup choose the folder you would like to open, most often the "Web Root (public_html/www)"
  5. Click the Go button. 
    Note: If you are in the File Manager already you can add &showhidden=1 to the end of the URL.
  6. Click the New File icon to create a new file and name it .htaccess

Alternative Index Files

You may not always want to use index.htm or index.html as your index file for a directory, for example, if you are using PHP files in your site, you may want index.php to be the index file for a directory. You are not limited to 'index' files though. Using .htaccess you can set foofoo.blah to be your index file if you want to!

Alternate index files are entered in a list. The server will work from left to right, checking to see if each file exists, if none of them exist it will display a directory listing (unless you have turned this off).

  • .htaccess, htaccess, create file
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

What is my absolute path?

Your absolute path is the same as what we refer to as the ""path to public_html"". It is...

How do I set a my own default index file when browsing to a directory?

To do this, create a file called "".htaccess"" in the directory with the following...

What is the difference between the www and public_html?

There is no difference between the two. The actual directory that you place your web files in is...

Setting folders to 0777 (i.e. world writable folders)

Since we run SuPHP setting permissions to 0777 is not possible. A 0777 permission makes the...

Custom Error Pages

You can customize your own error pages (for example when a file is not found) instead of using...

Powered by WHMCompleteSolution