Wiki

Clone wiki

DevFecta Public Repository / Apache Configuration

Setup Friendly URLs

http://localhost/index.php?url=pageTag to http://localhost/pageTag

Enable the mod_rewrite module

sudo a2enmod rewrite

Configure the server to recognize .htaccess files by modifying the 000-default.conf file

sudo nano /etc/apache2/sites-available/000-default.conf
Add the following code to the 000-default.conf file just before the </VirtualHost> closing tag:
<p>
<Directory /var/www/html><br/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
</Directory>
</p>
sudo systemctl restart apache2

Enable the RewriteEngine and set the RewriteRule

At a minimum add the following code to the website's .htaccess file:

RewriteEngine On
RewriteBase /
RewriteRule ^([^/]+)/? index.php?url=$1 [L,QSA]
https://hostadvice.com/how-to/how-to-enable-apache-mod_rewrite-on-an-ubuntu-18-04-vps-or-dedicated-server/

Updated