Stoppt die Vorratsdatenspeicherung! Jetzt klicken &handeln! Willst du auch an der Aktion teilnehmen? Hier findest du alle relevanten Infos und Materialien:

Archived entries for htaccess

.htaccess snippets

cats who code stellt 10 .htaccess Snippets vor. Unter anderem:

Force download of a specific filetype

<Files *.xls>
 ForceType application/octet-stream
 Header set Content-Disposition attachment
</Files>
<Files *.eps>
 ForceType application/octet-stream
 Header set Content-Disposition attachment
</Files>

Cross Domain Font embedding for Firefox

<FilesMatch "\.(ttf|otf|eot|woff)$">
<IfModule mod_headers.c>
 Header set Access-Control-Allow-Origin "http://yourdomain.com"
</IfModule>
</FilesMatch>

Configure your website for HTML5 videos

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
AddType video/ogg .ogv
AddType video/ogg .ogg
AddType video/mp4 .mp4
AddType video/webm .webm
AddType application/x-shockwave-flash swf

.htaccess snippets

10 .htaccess snippets von cats who code. Unter anderem:

Prevent hotlinking
RewriteEngine On
#Replace ?mysite\.com/ with your blog url
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
#Replace /images/nohotlink.jpg with your "don't hotlink" image url
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpg [L]

Force download of specific files
<files *.xls>
ForceType application/octet-stream
Header set Content-Disposition attachment
</files>
<files *.eps>
ForceType application/octet-stream
Header set Content-Disposition attachment
</files>

WordPress beschleunigen

Bei TalkPress gibt es einen Tip für die WordPress Performance, sollte man eine Version haben die vor 3.0 installiert und seit dem aktualisiert wurde.

Wenn du dein Blog mit einer Version von WordPress vor 3.0 aufgesetzt hast und “schöne” Permalinks verwendest, speichere jetzt die Permalink-Einstellungen noch einmal. Dein Blog wird dadurch schneller – sonst ändert sich nichts.

Offensichtlich gibt es einen verbesserten .htaccess Code der beim Updaten ansonsten nicht in die entsprechende Datei geschrieben wird.

Secure WordPress Installation

Es gibt zwar schon eine Menge Beiträge wie man die Sicherheit von WordPress erhöhen kann, aber 20 Steps to a Flexible and Secure WordPress Installation fand ich trotzdem lesenswert.

Dort gibt es eine Reihe Tipps die nicht nur für WordPress gültig sind. Insbesondere die .htaccess Einträge lassen sich (mit kleinen Anpassungen) auch allgemein anwenden.

Z.B.

# ESSENTIALS
ServerSignature Off
Options All -Indexes
Options +FollowSymLinks
# Suppress PHP errors (note that this might not work on all hosts):
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_value docref_root 0
php_value docref_ext 0
# Secure the wp-config.php file:
<Files wp-config.php>
 Order Deny,Allow
 Deny from all
</Files>

Und die .htaccess “Firewall” Perishable Press’ 4G Blacklist .

Erklärt: mod_rewrite

Joseph Pecoraro erklärt mod_rewrite, denn

Despite the tons of examples and docs, mod_rewrite is voodoo. Damned cool voodoo, but still voodoo.” — Brian Moore



Copyright © 2004–2009. All rights reserved. – Impressum

RSS Feed. This blog is proudly powered by Wordpress and uses Modern Clix, a theme by Rodrigo Galindez.