.htaccess
A configuration file used by Apache web servers to control website behaviour at the directory level.
It lets website administrators manage site functions such as URL redirection, access restrictions, and error handling without modifying the server's core configuration.
Common Uses of .htaccess:
Redirects: Directs users from one URL to another (e.g., for a moved page or to enforce HTTPS).
Access Control: Restricts access to certain files or directories by IP address or password.
Error Pages: Customizes error pages (e.g., 404 Not Found) for a better user experience.
Caching and Compression: Enhances site performance by enabling browser caching and compressing files.
The file is placed in a website’s root or subdirectory and executes configurations immediately, making it a powerful tool for managing server settings quickly.