Learn .htaccess - free tutorials

What is .htaccess?

An .htaccess file (short for Hypertext Access) is a configuration file for Apache web servers which allows you to control the URLs of your website and control access to your website and files.

An .htaccess file configures your server within the directory the .htaccess file is placed in and its sub-directories so you can place an .htaccess file in the root directory of your site to affect all directories or just in one sub-directory to only affect that directory and its sub-directories.

What is .htaccess used for?

An .htaccess file is used for things like redirecting URLs to other locations, rewriting or shortening URLs, blocking access to certain files and directories on your server and even blocking access to your site from a specific IP address.