szurubooru/public_html/.htaccess
Marcin Kurczewski c7250ae0a9 Improved thumbnail generating
- Moved thumbs folder to public_html/
- Users can supply custom thumbs of any size and the system will treat
  them like normal image
- Removed distinction between various thumb sizes in file system
- Introduced custom rewrite rule, which isn't exactly good-looking, but
  its benefits far outweigh its shortcomings
- Loading up to 75 times faster (was: 100-300ms, is: 4-10ms on my
  machine) thanks to removal of PHP proxying
2014-05-14 23:44:48 +02:00

53 lines
1.8 KiB
ApacheConf

DirectorySlash Off
Options -Indexes
RewriteEngine On
ErrorDocument 403 /dispatch.php?request=error/http&code=403
ErrorDocument 404 /dispatch.php?request=error/http&code=404
ErrorDocument 500 /dispatch.php?request=error/http&code=500
RewriteCond %{DOCUMENT_ROOT}/thumbs/$1.thumb -f
RewriteRule ^/?post/(.*)/thumb/?$ /thumbs/$1.thumb
RewriteRule ^/?thumbs/(.*).thumb - [L,T=image/jpeg]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /dispatch.php
RewriteRule ^/?$ /dispatch.php
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
<IfModule mod_mime.c>
AddType text/plain .map
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpg "access plus 2 years"
ExpiresByType image/gif "access plus 2 years"
ExpiresByType image/jpg "access plus 2 years"
ExpiresByType image/jpeg "access plus 2 years"
ExpiresByType image/png "access plus 2 years"
ExpiresByType image/x-icon "access plus 2 years"
ExpiresByType image/icon "access plus 2 years"
ExpiresByType application/x-ico "access plus 2 years"
ExpiresByType application/ico "access plus 2 years"
ExpiresByType text/plain "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType application/x-javascript "access plus 1 year"
</IfModule>