htaccess anpassen
Hallo zusammen!
Mag mir jemand helfen, meine htaccess an die Bedürfnisse von Wordpress anzupassen?
Ich nehme mal an, das ich mit all dem, was ich dort drin stehen habe, mich selbst ausbremse
SetOutputFilter DEFLATE
AddHandler php56-cgi .php
php_value memory_limit 256M
<IfModule mod_php5.c>
php_value post_max_size 32M
php_value upload_max_filesize 32M
php_value memory_limit 256M
php_value max_execution_time 300
php_value max_input_time 300
php_value session.gc_maxlifetime 86400
</IfModule>
RewriteRule ^login$ xxx/wp-login.php [NC,L]
<Files wp-login.php>
AuthName "Restricted Admin-Bereich"
AuthType Basic
AuthUserFile /xxx/xxx/xxx/xxx/.htpasswd
require valid-user
</Files>
php_flag log_errors on
php_value error_reporting E_ALL
php_value error_log /xxx/xxx/xxx/xxx/errorlog/error.log
# BEGINN CACHIFY
<IfModule mod_rewrite.c>
# ENGINE ON
RewriteEngine On
# GZIP FILE
<IfModule mod_mime.c>
RewriteCond %{REQUEST_URI} /$
RewriteCond %{REQUEST_URI} !^/wp-admin/.*
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} =""
RewriteCond %{HTTP_COOKIE} !(wp-postpass|
wordpress_logged_in|comment_author)_
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/cachify/%{HTTP_HOST}%
{REQUEST_URI}/index.html.gz -f
RewriteRule ^(.*) /wp-content/cache/cachify/%
{HTTP_HOST}/$1/index.html.gz [L]
AddType text/html .gz
AddEncoding gzip .gz
</IfModule>
# HTML FILE
RewriteCond %{REQUEST_URI} /$
RewriteCond %{REQUEST_URI} !^/wp-admin/.*
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} =""
RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|
comment_author)_RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/
cachify/%{HTTP_HOST}%
{REQUEST_URI}/index.html -f
RewriteRule ^(.*) /wp-content/cache/cachify/%{HTTP_HOST}/$1/index.html [L]
</IfModule>
# END CACHIFY
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
RewriteRule ^(wp-content/uploads.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]
</IfModule>
<IfModule mod_headers.c>
Header append Vary Accept env=REDIRECT_accept
</IfModule>
AddType image/webp .webp
# Mod Pagespeed
<IfModule pagespeed_module>
ModPagespeed on
# using commands,filters etc
</IfModule>
# Gzip Komprimierung
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
AddOutputFilterByType DEFLATE image/svg+xml application/
xhtml+xml application/xml
AddOutputFilterByType DEFLATE application/rdf+xml application/
rss+xml application/atom+xml
AddOutputFilterByType DEFLATE text/javascript application/
javascript application/x-javascript
AddOutputFilterByType DEFLATE application/x-font-ttf application/
x-font-otf
AddOutputFilterByType DEFLATE font/truetype font/opentype
</IfModule>
# Browsercache 1 Tag
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month 1 days"
ExpiresByType text/html "access plus 1 month 1 days"
ExpiresByType image/gif "access plus 1 month 1 days"
ExpiresByType image/jpeg "access plus 1 month 1 days"
ExpiresByType image/png "access plus 1 month 1 days"
ExpiresByType text/css "access plus 1 month 1 days"
ExpiresByType text/javascript "access plus 1 month 1 week"
ExpiresByType application/x-javascript "access plus 1 month 1 days"
ExpiresByType text/xml "access plus 1 seconds"
</IfModule>
# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "private"
</filesMatch>
# <filesMatch "\.(x?html?|php)$">
# Header set Cache-Control "private, must-revalidate"
# </filesMatch>
</ifModule>
# END Cache-Control Headers
#ETags entfernen
<ifModule mod_headers.c>
Header unset ETag
</ifModule>
FileETag None
# Hotlinking verbieten
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?salzsau-panorama\.de(/.*)?$ [NC]
RewriteCond %{HTTP_REFERER} !google\. [NC]
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
RewriteRule \.(gif|jpg|GIF|JPG|png|PNG)$ - [F]
# Zugriff auf Dateien verbieten / WordPress Sicherheit
<Files wp-config.php>
order allow,deny
deny from all
</Files>
<Files .htaccess>
order allow,deny
deny from all
</Files>
<Files readme.html>
Order Allow,Deny
Deny from all
Satisfy all
</Files>
<Files liesmich.html>
Order Allow,Deny
Deny from all
Satisfy all
</Files>
<Files install.php>
Order Allow,Deny
Deny from all
Satisfy all
</Files>
Options -Indexes
RewriteCond %{QUERY_STRING} !error
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(wp-includes|wp-content)/(.+)\.php\ HTTP/
RewriteRule .* - [F]
<ifmodule mod_rewrite.c>
RewriteCond %{QUERY_STRING} ftp\: [NC,OR]
RewriteCond %{QUERY_STRING} http\: [NC,OR]
RewriteCond %{QUERY_STRING} https\: [NC]
RewriteRule .* - [F,L]
</ifmodule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# protect wpconfig.php
<files wp-config.php>
order allow,deny
deny from all
</files>
Redirect 301 /+ plus.google.com/xxx/about
Redirect 301 /plus plus.google.com/xxx/about
RewriteCond %{QUERY_STRING} replytocom=
RewriteRule ^(.*)$ page_not_found.html [R=410,L]
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$
RewriteRule ^(.*)$ %{HTTP_HOST}/$1/ [R=301,L]
<IfModule mod_setenvif.c>
<Files xmlrpc.php>
BrowserMatch "Poster" allowed
BrowserMatch "WordPress" allowed
BrowserMatch "Windows Live Writer" allowed
BrowserMatch "wp-iphone" allowed
BrowserMatch "wp-android" allowed
Order Deny,Allow
Deny from All
Allow from env=allowed
</Files>
</IfModule>
# ----------------------------------------------------------------------
# Wichtige Sicherheitseinstellungen
# ----------------------------------------------------------------------
#wichtige Dateien gegen Zugriff von außen Blocken
<files install.php>
Order allow,deny
Deny from all
</files>
<files wp-config.php>
Order allow,deny
Deny from all
</files>
# PROTECT readme.html
<files readme.html>
Order Allow,Deny
Deny from all
Satisfy all
</Files>
# PROTECT liesmich.html für DE Edition
<Files liesmich.html>
Order Allow,Deny
Deny from all
Satisfy all
</Files>
<files error_log>
Order allow,deny
Deny from all
</files>
# Keine URL based exploits zulassen
RedirectMatch 403 \[
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Double slashes in allen URLs verbieten
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /(([^/\ ]+/)*)/+([^\ ]*)
RewriteRule ^ /%1%3 [L,R=301]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
RewriteRule ^(wp-content/uploads.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]
</IfModule>
Vielen Dank im voraus schon mal
Marcus
Das Regional-Magazin für Lüneburg und die Region:
salzsau-panorama.de
Beitrag erstellen
EinloggenKostenlos registrieren