When using the Apache web server, .htaccess
files (also called “distributed
configuration files”) are used to specify configuration on a per-directory basis,
or more generally to modify the behavior of the Apache web server without having
to access virtual hosts files directly (this is usually impossible for example, on shared
hosts). In this tutorial we see how we can establish URL redirections and rewriting rules
inside .htaccess
files.
This is a companion discussion topic for the original entry at https://linuxconfig.org/create-redirect-and-rewrite-rules-into-htaccess-on-apache-webserver