De Help Desk punt NL
Kennisbank
De Helpdesk > De Helpdesk > Kennisbank

htaccess beschermd je WordPress site

Oplossing Protection for all other .htaccess files in WordPress
Protection for WordPress wp-config.php file
Allows restrictions to files by file types / extensions
Limits the size of files that can be uploaded to your WordPress
Disables directory listing throughout all WordPress directories
Allows you to block an IP or a range of IP addresses
Allows you to block bad bots from spidering your WordPress website or blog
Blocks hotlinking of images and other media content
Allows you to configure professional looking custom error pages for WordPress

01 # We start by protecting all htaccess files in WordPress
02 # The below matches all htaccess filenames
03
04 order allow,deny
05 deny from all
06 satisfy all
07
08 # Protect WordPress files such as wp-config.php file
09 # More info: http://bit.ly/T6nNsL
10
11 order allow,deny
12 deny from all
13
14 # restrict access to files by filetype
15 # More info: http://bit.ly/T6nNsL
16
17 <FilesMatch "\.(htaccess|htpasswd|log|ini)$">
18 Order Allow,Deny
19 Deny from all
20
21 # Limit file upload size. If you do not accept file uploads
22 # you can configure this at a minimum as per the below.
23 # The below is configured for 1MB.
24
25 # Disable directory listing throughout your WordPress
26
27 Options All -Indexes
28
29 LimitRequestBody 1024000
30
31 # Block an IP or range of IPs
32 # Uncomment the line starting with deny and enter the IP
33 # More info: http://bit.ly/S5nzEF
34
35 order allow,deny
36 # deny from 172.16.130.106
37 allow from all
38
39 # If you would like to block Bad bots from accessing your WordPress
40 # Use the below syntax. Rename the User-Agent in the lines below.
41 # More info: http://bit.ly/S96xDU
42
43 RewriteEngine on
44 RewriteCond %{HTTP_USER_AGENT} ^evilbot [OR]
45 RewriteCond %{HTTP_USER_AGENT} ^spambot [OR]
46 RewriteCond %{HTTP_USER_AGENT} ^virusbot
47 RewriteRule ^(.*)$ http://no.access/
48
49 # Prevent websites from hotlinking to your WordPress
50 # More info: http://bit.ly/QoZgmG
51
52 RewriteEngine on
53 RewriteCond %{HTTP_REFERER} !^$
54 # Replace www.yourwebsite.com with your website URL
55 RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?www.yourwebsite.com [NC]
56 #Match all files with the below list of extensions
57 RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
58
59 # Configure custom error pages for your WordPress
60 # For a more professional look
61 # More info: http://bit.ly/UC7281
62
63 ErrorDocument 404 /notfound.php
64 ErrorDocument 403 /forbidden.php
65 ErrorDocument 500 /error.php
 
Was dit artikel bruikbaar? ja / nee
Gerelateerde artikelen Wordpress - Uitsluiten toegang tot includes van buitenaf
16 Useful .htaccess Tricks and Hacks For Web Developers
SSL / HTTPS forceren voor domein
Mappen beschermen tegen phishing bestanden
Wordpress handleiding Nederlands
Wordpress fout: is_dir(): open_basedir
Uitschakelen Thema en Plugin editor in Wordpress
Nagios installeren op CentOS 7
Forceer HTTPS op je domein
Blokkeren hotlinken afbeeldingen
Artikel details
Artikel ID: 176
Categorie: wordpress
Zoekwoorden
Datum toegevoegd: 1-May-2013 12:51:45
Aantal bekeken: 1060
Beoordeling (Stemmen): Artikel beoordeeld 3.2/5.0 (31)

 
« Ga terug