Htaccess files are hidden plain text files that are on the server to help control how your visitors interact with your website. The htaccess file is also used to block specific traffic from being able to view your website. If you look for your .htaccess file you'll see that there's no filename. The extension is .htaccess which tells the server what type of file it is. In cPanel you can see if you have a current .htaccess file using file manager but you will need to make sure you have selected to view hidden files. If you are not familiar with using file manager please read our article.  To view hidden files in file manager, select the 'file manager' icon in cPanel and make sure the box is checked next to 'Show Hidden Files.' Then click 'OK' and you will be able to view hidden files. 

What can you do with a .htaccess file?

You might have a private area of your website you wish to keep password protected. This password protection is actually set up in the .htaccess file. Most of the functions of the htaccess file, you do not have to concern yourself with as they will be automatically written through cPanel. This is the case of password protecting directories. While you set it up in cPanel, it actually writes a directive to your htaccess file. 

Other functions of the htaccess file include, prohibiting hotlinks, rewriting URLs, setting default pages, creating redirects, reconfiguring account settings, and much more. It's really important to realize how the htaccess file can affect your entire account. Changing something in the htaccess file can alter how your website functions so it's really important BEFORE making changes to your htaccess to backup your current htaccess file.

Troubleshooting Errors caused by the .htaccess File

If you are getting errors on your website, the .htaccess file can often be the culprit. This is easily tested by renaming your current htaccess file. Often, during troubleshooting I'll simply rename the .htaccess to .htaccess.old and now I'll reload the website. If the site loads I then know the issue resides in my configuration of the .htaccess file. If it does not fix the issue I was having, I'll rename the htaccess by removing the .old I added to the end. That way, it won't affect my website after I resolve the issue. 

If you need further assistance with your .htaccess file or have any further questions please feel free to contact our support department

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Related Questions

Here are a few questions related to this article that our customers have asked:
Stop Subdomain From Redirecting
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2014-08-11 11:32 am

I am having question on .htaccess file.  i accidentally override with another file content then my website come with errror, then i found the file and removed all the content inside .htaccess file then it started working fine but my question is when i deleted the content if i also deleted important document, pls tell me if there is some content deleted.

thank you

Staff
10,207 Points
2014-08-11 11:45 am
Hello biruhtesfa,

Thank you for your question. There is no way to tell if the content you deleted in the .htaccess file is important.

This is because websites can be coded many ways.

I recommend testing all aspects of your website (shopping carts, forms, scripts, etc.) to make sure it is still functioning after editing your .htaccess file.

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul
n/a Points
2014-11-15 8:49 am

if i delete .htaccess by mistake what must i do

Staff
10,207 Points
2014-11-17 9:13 am
Hello yusuf,

Thank you for your question. If you deleted your .htaccess file, you can just create a new file and name it: .htaccess

Then add your rules back as needed.

If you have any further questions, feel free to post them below.

Thank you,
John-Paul

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

4 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!