Created
December 21, 2011 14:12
-
-
Save sergejmueller/1506173 to your computer and use it in GitHub Desktop.
Beispiel einer .htaccess Datei unter WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Admin absichern | |
<Files wp-login.php> | |
AuthName "Admin-Bereich" | |
AuthType Basic | |
AuthUserFile /var/www/pfad/.htpasswd | |
require valid-user | |
</Files> | |
# Zugriff verweigern | |
<FilesMatch "(\.htaccess|\.htpasswd|wp-config\.php|liesmich\.html|readme\.html|xmlrpc\.php)$"> | |
order deny,allow | |
deny from all | |
</FilesMatch> | |
# GZIP | |
<IfModule mod_deflate.c> | |
<FilesMatch "\.(js|css)$"> | |
SetOutputFilter DEFLATE | |
</FilesMatch> | |
</IfModule> | |
# Cache für 3 Monate | |
<IfModule mod_expires.c> | |
<FilesMatch "\.(png|ico|js|css)$"> | |
ExpiresActive On | |
ExpiresDefault A7776000 | |
Header unset ETag | |
Header append Vary Accept-Encoding | |
</FilesMatch> | |
</IfModule> | |
# PHP 5.3 | |
AddHandler php53-cgi .php | |
# Rewrites | |
<IfModule mod_rewrite.c> | |
# Default | |
RewriteEngine On | |
RewriteBase / | |
# CSS | |
RewriteRule ^css/.+\.css$ /wordpress/wp-content/themes/playground/style.css [L] | |
# IMG | |
RewriteRule ^img/theme/(.*)\.png$ /wordpress/wp-content/themes/playground/img/$1.png [L] | |
# Avatare | |
RewriteRule ^img/gravatar/(.*)\.png$ /wordpress/wp-content/gravatar/cache/$1.png [L] | |
# Lose BlogID | |
RewriteRule ^(\d+)/$ /?p=$1 [R=301,L] | |
# WordPress | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment