BUSINESS COACHINGDESIGNPRODUKTETEST BLOGΛLLGEMEINΛTELIER

.htaccess Datei WP

Die .htaccess Datei ist wichtig, beim Thema Suchmaschinenoptimierung (SEO)


# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

# FIX CLICKJACKING
Header set X-Frame-Options DENY

## BLOCK SENSITIVE FILES ##
# PROTECT .HTACCESS FILES

# PROTECT FROM SPAM BOTS (Prevent bots with no user agent from hitting the site)

RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .wp-comments-post.php*
RewriteCond %{HTTP_REFERER} !.example.com.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]


## INCREASE SITE SPEED ##
#  ENABLE OUTPUT COMPRESSION

# PREVENT USERNAME ENUMERATION
RewriteCond %{QUERY_STRING} author=d
RewriteRule ^ /? [L,R=301]


<FilesMatch "\\.(js|css|html|htm|php|svg|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>

<filesMatch "\\.(js|js.gz)$">
Header set Cache-Control "max-age=604800, private"
</filesMatch>

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##

<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>

 


Mit dieser Lösung hab ich es mit meiner WP-Webseite von 60 auf 80/100 geschafft.

Hier können sie ihre Webpräsenz testen.

https://developers.google.com/speed/pagespeed/insights/

https://tools.pingdom.com/

https://search.google.com/search-console/mobile-friendly


Hier gibts noch einige Tips zum Thema .htaccess Datei

https://wpdoityourself.com/wordpress-htaccess-basics-beginners/

 

Schreibe einen Kommentar