CATEGORIES

TAGS

SSL

PostgreSQL

cPanel

email

Error

WHM

Linux

Bash

Debian

Ubuntu

What is .htaccess? For what you can use it.

16th August
Linux
What is .htaccess? For what you can use it.

Let’s understand what .htaccess file means. “ht” is initials of Hypertext that is to say “Hypertext Access”. that file is configuration file and the name of this file is ”.htaccess” without any name and extensions. That file is used by Apache based servers. .htaccess file controls the directories into which it is located and its sub-directions. You can make changes into an already existing .htaccess file, which will be among the files which you will upload for your server, or create your own in that directory which you want to configure.
What opportunities can give us a .htaccess file? For example, you can use a different file as the index file, via .htaccess your folders can be protected by the password, ban or allow users using IP addresses, create custom error pages, you can change the file extension, redirect users to another page or directory automatically.
Here is an example of how you can create your custom error page with the .htaccess file. To do this you should know what is the error code. You can read about most common error codes here. Just create some document with your favorite text editor and into that document write this syntax:
Copied!

ErrorDocument 404 /yourCustomErrorFile.html



Save that document and make sure that the name of this file is “.htaccess” without any .txt, .doc, or some other extension, then upload the document into your host’s root directory or where you need.


SUBSCRIBE by email and never miss a post!