onsa
1/19/2017 - 11:13 AM

Enable modules globally

Enable modules globally

<IfModule mod_rewrite.c>
  RewriteEngine On
  
  # prefix relative substitution (e.g. base = /admin/, substitution = index.php -> substitution = /admin/index.php)
  RewriteBase [base]
  
  # delete trailing slashes if not a folder
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)/$ $1 [L,R=301]
</IfModule>
# syntax

  RewriteRule [regex] [substitution] [flags]
  # substitution is relative to domain
  # if leading slash is omitted in a folder context (i.e. in .htacess), substitution is relative to current folder

# enable module

  a2enmod rewrite

# restart apache

  service apache2 restart