Have a Question?

Categories

How to create .htaccess file?

You are here:
< All topics
Table of contents

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.

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we correct this article?
Please submit the reason for your vote so that we can improve the article.
Tags:
Previous How to Change your Default Index Page in htaccess
Next How to redirect my site from HTTP to HTTPS?