41 lines
1.1 KiB
ApacheConf
Executable File
41 lines
1.1 KiB
ApacheConf
Executable File
ErrorDocument 404 /
|
|
ErrorDocument 403 /
|
|
IndexIgnore *
|
|
|
|
# Prohibiting access to /protected
|
|
RedirectMatch 404 ^/protected/?$
|
|
|
|
<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
|
|
# Only rewrite in base directory
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
RewriteRule ^([^\/]+)\.(jpg|png|gif|webp|mp4)$ uploads/$1.$2 [L]
|
|
|
|
# Rewrite requests going into an unknown /static/ folder
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
RewriteRule ^(.+)\/(static)\/(.+) static/$3 [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> |