InMotion Hosting Support Center

In this article I quickly show you where your account's .htaccess file resides on the server, as well as how to edit it.

You can make similar changes in the Apache configuration file, but only with root access. That's why the .htaccess file is very important to users on our Business Hosting accounts.

What is .htaccess?

The .htaccess file is a hidden text file that allows you to control the way visitors access your site. Some common uses of the .htaccess file would be restricting access to certain files or redirecting URLs.

You can review our full .htaccess file reference list for more examples of what you can do with a .htaccess file.

Where is my .htaccess file?

By default you should have a .htaccess file created on your account in the following directory:

/home/userna5/public_html/.htaccess

You can use your favorite FTP client to modify this file or follow the steps below to access it directly from cPanel:

  1. Login to your cPanel.
  2. Under the Files section, click on File Manager.
  3. Locate your .htaccess file, you may have to show hidden files (click Settings-->Check the "Show Hidden Files (dotfiles)" box).
  4. Right-click on the .htaccess file and select Edit.
  5. If you didn't locate your .htaccess file during the previous step, click on +File on the top-left, name the file .htaccess, and finally set the directory for the file to be created to /public_html/ or the document root of your site.
  6. You might have a text editor encoding dialog box pop-up, you can simply click on Edit.

Congratulations, now you know how to locate, and edit your .htaccess file!

Did you find this guide helpful? When you're an InMotion Web Hosting customer, you get full access to the vast library of our support documentation as well as world-class, 24/7 support.

Was this article helpful?

Related Questions

Here are a few questions related to this article that our customers have asked:
I cannot remember my .HC Custom WP-Admin URL slug word
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

n/a Points
2018-05-03 5:37 pm

I have found several htaccess files throughout my web site. The site has gone through several formats over the past 8 years. To effectively utilize my forced https code insertion into a default htaccess file, where do I place it in the root? Directly into the /public_html/? Is it then safe to delete all of the other htaccess files I find scattered throughout the site or are those issuing directives for plugins? One of them has some Leverage Browser Caching Ninja code inserted to set peramiters for the Caching Ninja plugin. Of which I am not so sure does anything.

Staff
31,313 Points
2018-05-03 6:18 pm
Typically, you would put the .htaccess in the root directory of the website, but it can inherit rules from "parent" folders. It is difficult to say if you need the other .haccess files, since your website may rely on existing rules. Also, if you are using a CMS such as WordPress, Joomla, Drupal, etc. I recommend using a plugin, addon or extension instead of adding a rule directly to the .htaccess file. This is because CMS' rely on .htaccess rules too and custom coded rules can interfere with their functionality.

Thank you,
John-Paul
n/a Points
2018-10-10 6:42 am

Thanks for this useful answer. But I still wonder why there are so many, .htaccess files and who creates this

Staff
42,247 Points
2018-10-10 10:12 am
.htaccess files may be automatically created by existing applications, or by people adding code for different purposes. So, if you're using a few plugins for your website, it is possible that code is being added to the .htaccess files. I hope that helps to provide some clarity on the issue.

If you have any further questions or comments, please let us know.

n/a Points
2017-09-30 7:57 pm

super easy and super useful.

Thank you!

n/a Points
2017-05-10 6:47 pm

If we have (Windows with) MS-IIS?

Staff
31,313 Points
2017-05-11 9:18 am
IIS (ASP) does not use an .htaccess file by default. You can often accomplish similar tasks with the IIS Security options.

Thank you,
John-Paul
n/a Points
2017-01-07 8:00 pm

Omg, thank you so much. 

n/a Points
2016-03-10 6:08 am

.htaccess not supprt to nginx

Staff
31,313 Points
2016-03-10 4:27 pm
Hello Yogesh,

Thank you for contacting us. Yes, your .htaccess rules must be translated to work with nginx.

There are many online tools available that can help you with that, as described in this post I found online.

Thank you,
John-Paul
n/a Points
2015-07-05 1:47 pm
great!!
n/a Points
2015-05-02 2:20 pm
Greate tips . i appriciate thank you boss
n/a Points
2015-03-01 10:10 pm
I think the article was the best it can be. Thanks!
n/a Points
2015-02-20 12:30 am
Works perfectly for host monster :)
n/a Points
2015-01-28 9:27 am

You Desere a salute....I was wandering since last 3 days...and you did the miracle by simpliying this.

 

Thanks

n/a Points
2015-01-21 7:25 am
Its just right. up to the point.
n/a Points
2015-01-12 12:35 pm
No improvement needed
n/a Points
2015-01-05 4:02 am

first of all thank you so much,

you are did a great job with your suggestion..

 

 

 

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.

18 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!