RewriteEngine On
RewriteBase /

# Redirect to www (optional, but good for SEO)
# RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

# Redirect trailing slashes
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ $1 [L,R=301]

# Route all requests to index.php if the file or directory doesn't exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

# Prevent directory listing
Options -Indexes

# PHP Upload Limits
<IfModule mod_php7.c>
    php_value upload_max_filesize 100M
    php_value post_max_size 120M
    php_value memory_limit 512M
</IfModule>
<IfModule mod_php.c>
    php_value upload_max_filesize 100M
    php_value post_max_size 120M
    php_value memory_limit 512M
</IfModule>
