Hallo Leute,
was meint Ihr wie sieht eine gute .htaccess für Wordpress aus, damit es sicher läuft und die
Webseite schnell geladen wird.
Mein Vorschlag :
Notwendig oder überflüssig ?
Code
<IfModule mod_mime.c>
AddType text/css .css
AddType text/x-component .htc
AddType application/x-javascript .js
AddType application/javascript .js2
AddType text/javascript .js3
AddType text/x-js .js4
AddType text/html .html .htm
AddType image/svg+xml .svg .svgz
AddType text/plain .txt
AddType text/xsd .xsd
AddType text/xsl .xsl
AddType text/xml .xml
AddType image/gif .gif
AddType application/x-gzip .gz .gzip
AddType image/x-icon .ico
AddType image/jpeg .jpg .jpeg .jpe
AddType application/json .json
AddType application/pdf .pdf
AddType image/png .png
AddType application/zip .zip
</IfModule>
Alles anzeigen
Zur Sicherheit des Wordpress:
Für schönere URLs und zur Vermeidung von Duplicate Content:
Apache Configuration
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{HTTP_Host} ^deine-seite\.info$ [NC]
RewriteRule ^(.*)$ http://www.deine-seite.de/$1 [R=301,L]
</IfModule>
Weitere Sicherheitsmaßnahme für den Wordpress-Login:
Apache Configuration
<files wp-login.php>
AuthName "gf"
AuthType Basic
AuthUserFile /home/irgendwas/www/www.deine-seite.de/htdocs/.htpasswd
require valid-user
</files>
Expires setzen damit nicht alles bei jeden Webseitenbesuch neu geladen werden muss, Stichwort Wordpress schneller machen:
Code
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
ExpiresByType text/html "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year”
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType text/css "access plus 1 month”
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType text/x-component A31536000
ExpiresByType text/x-js A31536000
ExpiresByType text/xml A3600
</IfModule>
Alles anzeigen
Hier weiss ich nicht ob das Sinn macht:
Code
<FilesMatch "\.(css|less|js|js2|js3|js4|CSS|HTC|LESS|JS|JS2|JS3|JS4)$">
FileETag MTime Size
</FilesMatch>
<FilesMatch "\.(htm|txt|xsd|xsl|xml|HTM|XSD|XSL|XML)$">
FileETag MTime Size
</FilesMatch>
<FilesMatch "\.(gif|gz|gzip|ico|jpg|jpeg|jpe|json|pdf|png|ZIP)$">
FileETag MTime Size
</FilesMatch>
Was meint Ihr zu den einzelnen Angaben ? Wie schaut eure aus ?
Grüße
Marcus