add case insentive and force download support

This commit is contained in:
2023-02-22 07:19:59 +10:00
parent bde47e1251
commit 686b0a167d

View File

@@ -3,6 +3,14 @@
Options -MultiViews -Indexes
</IfModule>
<IfModule mod_headers.c>
<FilesMatch "\.(?i:pdf|doc|docx|zip|txt|mp4)$">
<If "%{QUERY_STRING} =~ /(^|&)download=1($|&)/">
Header set Content-Disposition "attachment"
</If>
</FilesMatch>
</IfModule>
RewriteEngine On
# Add www subdomain if missing
@@ -21,7 +29,7 @@
# Pass to media handler if the media request has query
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{QUERY_STRING} .
RewriteRule ^uploads/(.+)\.(jpg|png)$ media.php?url=uploads/$1.$2 [QSA,L]
RewriteRule ^uploads/(.+)\.(jpe?g|png)$ media.php?url=uploads/$1.$2 [NC,QSA,L]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d