Files
plugi/.htaccess
T
deepDiverPaul 25030638a4 Implemented: editor uploads are constrained to safe image files inside
the upload tree, and public form submissions are
size-bounded and rate-limited
2026-11-30 16:51:15 +01:00

38 lines
1.3 KiB
ApacheConf

<IfModule mod_rewrite.c>
RewriteEngine On
# Redirect non-www. to www. (except when on a subdomain)
# RewriteCond %{HTTP_HOST} !^www\.
# RewriteCond %{HTTP_HOST} !^(.*)\.(.*)\. [NC]
# RewriteRule ^ https://www.%{HTTP_HOST}/$1 [R=301,L]
# Redirect HTTP to HTTPS
# RewriteCond %{HTTPS} !=on
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
# Remove any trailing slashes from non-directories using a redirect
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteCond %{REQUEST_URI} (.+)/$
# RewriteRule ^ %1 [R=301,L]
# Rewrite /themes/{theme}/{file} to /themes/{theme}/public/{file}
RewriteRule ^themes/([^/]+)/(?!public/)(.*)$ themes/$1/public/$2 [L]
# Rewrite non-directory and non-file URLs to index.php
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteRule ^ index.php [L]
# Allow direct access to theme files with URL format: /themes/{theme}/public/{file}
RewriteRule ^themes/([^/]+)/public/(.*)$ themes/$1/public/$2 [L]
# Allow direct access to uploaded files with URL format: /uploads/{filepath;,}
RewriteRule ^uploads/.*\.(?:php[0-9]*|phtml|phar)(?:/|$) - [F,NC]
RewriteRule ^uploads/(.*)$ uploads/$1 [L]
# Rewrite all remaining requests to index.php
# RewriteRule ^ index.php [L]
</IfModule>
FallbackResource /index.php