Knowledgebase

How to Use .htaccess  Print this Article

Introduction

The .htaccess file is a configuration file that can be used to modify the default parameters of an Apache web server. If such a file exists, it is read by the server before each web file access via the HTTP or HTTPS protocol. Note that several changes to .htaccess can be made without having to manually change the file, but by using the corresponding page in the cPanel (redirections, folder security, etc.).

Usage

You just need to create the file with Notepad or any other application that can write documents in pure text (not Microsoft Word) and save it with the name ".htaccess" (no quotation marks). You then need to transfer the file to the server via FTP or by using the cPanel's file manager. The .htaccess file must be placed in the folder containing the HTML/PHP/other pages you want it to affect. It is important to note that the .htaccess file will affect all files in the folder and its subfolders, unless another .htaccess file exists in that subfolder.

Contents and syntax

Here are some articles explaining the .htaccess file:

http://httpd.apache.org/docs/2.1/howto/htaccess.html

http://www.javascriptkit.com/howto/htaccess.shtml

Was this answer helpful?

Related Articles

Reduce Spam/Junk Mail
Spam (or junk mail) is any unsollicited electronic message. Although it is hard to get fully rid...
How to Create a Backup
Here are the steps to create a backup of your website: Connect to cPanel Under Files, select...
How to Block a Domain or IP Address
This article is intended for advanced users only. Please do not block IP addresses unless you...
How to react in case of account hacking
Why would someone want to hack my web site? While every case is different, there are many...
How to Unblock Your IP From Our Firewall
Our Firewall protects your account from hackers, malware, and other security threats. At times,...