Apache Server Setup

From rbachwiki
Revision as of 21:35, 9 October 2018 by Bacchas (talk | contribs) (Created page with "Create a .htaccess file in website directory <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Create a .htaccess file in website directory

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /
 RewriteRule ^index\.html$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.html [L]
</IfModule>

Edit the apache2.conf file

file is located in the /etc/apache2 dir

<Directory /var/www/>
AllowOveride All
</Directory>

To enable mod rewrite

a2enmod rewrite