.htaccess basic configuration

- 1 min read
Apache logo
Apache logo

Here I will explain a basic configuration of a ‘.htaccess‘. This file is a directory-level configuration file supported by several web servers, that allows for decentralized management of web server configuration. It’s more secure to edit the ‘.htaccess‘ than que ‘http.conf‘.

With this file you can configure a lot of things in Apache, but the most interesting (for me) are:

404 Custom Error Page

ErrorDocument 404 code/404.php

301 Redirect

Redirect 301 /path/old.php /path/new.php

Prevent Directoy Listing

IndexIgnore *

Custom Index Files

DirectoryIndex index.html index.php helloo.html

Share: Link copied to clipboard


Previous: Basic CSS for a Responsive Web
Next: Basic JavaScript/jQuery example for begginers

Where: Home > Technical > .htaccess basic configuration