... | ... | @@ -38,9 +38,6 @@ RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] |
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Wenn Sie die HTACCESS Datei über htaccess.custom.php erweitert haben, müssen Sie noch den Aktualisierungsschritt ausführen.
|
|
|
Dies geht einfach über folgenden CLI Befehl:
|
|
|
|
... | ... | @@ -48,95 +45,5 @@ Dies geht einfach über folgenden CLI Befehl: |
|
|
php quiqqer.php --tool=quiqqer:htaccess
|
|
|
```
|
|
|
|
|
|
Weitere Beispiele
|
|
|
======
|
|
|
|
|
|
HTACCESS für PageSpeed optimiert
|
|
|
------
|
|
|
|
|
|
Damit dieses .htaccess customizing funktioniert müssen einige Module im Apache aktiviert.
|
|
|
|
|
|
```bash
|
|
|
a2enmod headers deflate expires gzip
|
|
|
```
|
|
|
|
|
|
Danach erweitern Sie wie oben beschrieben die `htaccess.custom.php` Datei im `etc` Ordner
|
|
|
|
|
|
```
|
|
|
#<?php exit; ?>
|
|
|
# custom htaccess
|
|
|
|
|
|
# Turn ETags Off
|
|
|
<ifmodule mod_headers.c>
|
|
|
Header unset ETag
|
|
|
Header unset Last-Modified
|
|
|
</ifmodule>
|
|
|
|
|
|
FileETag None
|
|
|
|
|
|
<ifModule mod_headers.c>
|
|
|
Header set Connection keep-alive
|
|
|
</ifModule>
|
|
|
|
|
|
<IfModule mod_deflate.c>
|
|
|
AddOutputFilterByType DEFLATE text/plain
|
|
|
AddOutputFilterByType DEFLATE text/html
|
|
|
AddOutputFilterByType DEFLATE text/xml
|
|
|
AddOutputFilterByType DEFLATE text/css
|
|
|
AddOutputFilterByType DEFLATE text/javascript
|
|
|
AddOutputFilterByType DEFLATE application/xml
|
|
|
AddOutputFilterByType DEFLATE application/xhtml+xml
|
|
|
AddOutputFilterByType DEFLATE application/rss+xml
|
|
|
AddOutputFilterByType DEFLATE application/atom_xml
|
|
|
AddOutputFilterByType DEFLATE application/javascript
|
|
|
AddOutputFilterByType DEFLATE application/x-javascript
|
|
|
AddOutputFilterByType DEFLATE application/x-shockwave-flash
|
|
|
AddOutputFilterByType DEFLATE image/svg+xml
|
|
|
</IfModule>
|
|
|
|
|
|
<IfModule mod_gzip.c>
|
|
|
mod_gzip_on Yes
|
|
|
mod_gzip_dechunk Yes
|
|
|
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
|
|
|
mod_gzip_item_include handler ^cgi-script$
|
|
|
mod_gzip_item_include mime ^text/.*
|
|
|
mod_gzip_item_include mime ^application/x-javascript.*
|
|
|
mod_gzip_item_exclude mime ^image/.*
|
|
|
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
|
|
|
</IfModule>
|
|
|
|
|
|
<IfModule mod_expires.c>
|
|
|
ExpiresActive On
|
|
|
ExpiresByType text/css "access plus 1 week"
|
|
|
ExpiresByType text/javascript "access plus 1 week"
|
|
|
ExpiresByType text/html "access plus 1 week"
|
|
|
ExpiresByType application/javascript "access plus 1 week"
|
|
|
ExpiresByType application/x-javascript "access plus 1 week"
|
|
|
ExpiresByType application/xhtml-xml "access plus 600 seconds"
|
|
|
ExpiresByType image/gif "access plus 1 month"
|
|
|
ExpiresByType image/jpeg "access plus 1 month"
|
|
|
ExpiresByType image/png "access plus 1 month"
|
|
|
ExpiresByType image/svg+xml "access plus 1 month"
|
|
|
ExpiresByType image/x-icon "access plus 1 month"
|
|
|
</IfModule>
|
|
|
|
|
|
<ifmodule mod_headers.c>
|
|
|
<filesmatch "\\.(ico|jpe?g|png|gif|swf)$">
|
|
|
Header set Cache-Control "max-age=2592000, public"
|
|
|
</filesmatch>
|
|
|
<filesmatch "\\.(css)$">
|
|
|
Header set Cache-Control "max-age=604800, public"
|
|
|
</filesmatch>
|
|
|
<filesmatch "\\.(js)$">
|
|
|
Header set Cache-Control "max-age=604800, private"
|
|
|
</filesmatch>
|
|
|
<filesmatch "\\.(x?html?|php)$">
|
|
|
Header set Cache-Control "max-age=600, private, must-revalidate"
|
|
|
</filesmatch>
|
|
|
</ifmodule>
|
|
|
|
|
|
<IfModule mod_headers.c>
|
|
|
Header append Vary Accept-Encoding
|
|
|
</IfModule>
|
|
|
|
|
|
``` |
|
|
\ No newline at end of file |
|
|
Weitere Beispiele:
|
|
|
- [QUIQQER Optimizer](https://dev.quiqqer.com/quiqqer/package-cache/wikis/apache) |
|
|
\ No newline at end of file |