How to Enabling mod_rewrite in Apache on Ubuntu 18.04

Introduction

Apache’s mod_rewrite module lets you rewrite URLs in a cleaner fashion, translating human-readable paths into code-friendly query strings. It also lets you rewrite URLs based on conditions.

An .htaccess file lets you create and apply rewrite rules without accessing server configuration files. By placing the .htaccess file in the root of your web site, you can manage rewrites on a per-site or per-directory basis.

In this tutorial, you’ll enable mod_rewrite for Apache in Ubuntu 18.04