Skip to main content

How to create .htaccess file?

You can create an .htaccess directly on your web server using an FTP client, cPanel internal File Manager or SSH. View the following articles for instructions on how to use either option to create the file:

If you’re using an FTP client, make sure it has been configured to show hidden files. This is necessary since the .htaccess file begins with a period.

 

Make sure that when you create the .htaccess file you do NOT add a file extension. This file should only be titled .htaccess with no extension.

WHAT PERMISSIONS SHOULD THE FILE HAVE?

644 permissions are usually fine for an .htaccess file. When you create the file on the server, it should already have these permissions set, so there is most likely nothing to change.

WHERE TO PUT YOUR .HTACCESS FILE?

Generally, you put the .htaccess file in your website’s main directory. However, the location ultimately depends on what you’re attempting to do with the .htaccess file.

The .htaccess file can control behavior for every directory under the folder it resides in. For this reason it can also be in your user’s home directory. Again, it depends on what you’re using the .htaccess file for.