How To Securely Access Your Website .htaccess File

How To Securely Access Your Website .htaccess File

At EntreBase we want to make sure you always have the tools necessary to secure your information and data without the need for an enterprise security solution. This tutorial is provided to enable the beginner to experienced website administrator with basic security concepts around securing your personal or small business website and domain with best minimal security practices.

Always make sure you access this file in SSL secure https: mode: Force HTTPS in cPanel.

In this article we quickly show you where your hosting 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 as a server admin. That’s why the .htaccess file is very important to users and website administrators on EntreBase 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 (Available Soon) 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 hosting account in the following directory:

example: /home/username/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:

Step 1: Login to your cPanel securely in HTTPS.

Step 2: Under the Files section, click on File Manager.

Step 3: Locate your .htaccess file, you may have to show hidden files

(click Settings–>Check the “Show Hidden Files (dotfiles)” box).

Right-click on the .htaccess file and select Edit.

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.

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!

“Warning: You should only access and edit this file, if you are experienced or have enough know how to edit this file and not comprise the integrity of this file. This file is important to the functioning and security of your website. Always make a backup of this file prior to editing in case you need to restore it due to errors encountered.”

Did you find this guide helpful? Please share & follow below and let us know via LinkedIn or Twitter as we would love to hear from you. As always, we’re here if you need someone to assist you and help you get the job done: Hire Us!

About the Contributor
The Team @ EntreBase
We are a Veteran Owned full service Information Technology (IT) company offering Secure Cloud and Cyber Information Technology Infrastructure, Services and Support to the virtual workforce.