Shadis/public/.htaccess

33 lines
854 B
ApacheConf
Executable File

ErrorDocument 404 /
ErrorDocument 403 /
IndexIgnore *
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Force trailing slash
RewriteCond %{REQUEST_URI} /+[^\.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]
# Rewrite jpg/png/gif/webp file access to uploads folder
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/uploads/$1.$2 -f
RewriteRule ^(.+)\.(jpg|png|gif|webp)$ uploads/$1.$2 [L]
# Don't rewrite files or directories
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite everything else to index.php to allow html5 state links
RewriteRule . /index.php [L]
</IfModule>
<IfModule mod_deflate.c>
<filesMatch "\.(js|css|html|php)$">
SetOutputFilter DEFLATE
</filesMatch>
</IfModule>