.htaccess updates, expires and compression headers
This commit is contained in:
parent
4040fb5d58
commit
2eea8b22f2
1 changed files with 23 additions and 11 deletions
34
.htaccess
34
.htaccess
|
@ -1,23 +1,23 @@
|
||||||
<IfModule mod_dir.c>
|
<IfModule mod_dir.c>
|
||||||
DirectoryIndex index.php5 index.php
|
DirectoryIndex index.php5 index.php
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
<FilesMatch "\.(sqlite|sdb|s3db|db)$">
|
<FilesMatch "\.(sqlite|sdb|s3db|db)$">
|
||||||
Deny from all
|
Deny from all
|
||||||
</FilesMatch>
|
</FilesMatch>
|
||||||
|
|
||||||
<IfModule mod_rewrite.c>
|
<IfModule mod_rewrite.c>
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
|
|
||||||
# rather than link to images/ha/hash and have an ugly filename,
|
# rather than link to images/ha/hash and have an ugly filename,
|
||||||
# we link to images/hash/tags.ext; mod_rewrite splits things so
|
# we link to images/hash/tags.ext; mod_rewrite splits things so
|
||||||
# that shimmie sees hash and the user sees tags.ext
|
# that shimmie sees hash and the user sees tags.ext
|
||||||
RewriteRule ^_images/([0-9a-f]{2})([0-9a-f]{30}).*$ images/$1/$1$2 [L]
|
RewriteRule ^_images/([0-9a-f]{2})([0-9a-f]{30}).*$ images/$1/$1$2 [L]
|
||||||
RewriteRule ^_thumbs/([0-9a-f]{2})([0-9a-f]{30}).*$ thumbs/$1/$1$2 [L]
|
RewriteRule ^_thumbs/([0-9a-f]{2})([0-9a-f]{30}).*$ thumbs/$1/$1$2 [L]
|
||||||
|
|
||||||
# any requests for files which don't physically exist should be handled by index.php
|
# any requests for files which don't physically exist should be handled by index.php
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
RewriteRule ^(.*)$ index.php?q=$1&%{QUERY_STRING} [L]
|
RewriteRule ^(.*)$ index.php?q=$1&%{QUERY_STRING} [L]
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
<IfModule mod_php5.c>
|
<IfModule mod_php5.c>
|
||||||
|
@ -27,3 +27,15 @@ RewriteRule ^(.*)$ index.php?q=$1&%{QUERY_STRING} [L]
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
DefaultType image/jpeg
|
DefaultType image/jpeg
|
||||||
|
|
||||||
|
<IfModule mod_expires.c>
|
||||||
|
ExpiresActive On
|
||||||
|
ExpiresDefault "access plus 1 month"
|
||||||
|
ExpiresByType text/html "now"
|
||||||
|
ExpiresByType text/plain "now"
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
<ifmodule mod_deflate.c>
|
||||||
|
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
|
||||||
|
AddOutputFilterByType DEFLATE application/x-javascript application/javascript
|
||||||
|
</ifmodule>
|
||||||
|
|
Reference in a new issue