Apache2 is one of the most widely used HTTP server has a lot of features and can be customized in many ways.
In fact, to this web server, there are basically two ways you can do this, using .htaccess directives or using a file httpd.conf. .
Some people prefer to use. htaccess files, since they reside in the website and can be modified by the site owner, which is not the case for the daemon configuration file:
RedirectMatch permanent ^/(.*) http: