.htaccess-Generator für WordPress
Schutz auf Server-Ebene, ohne Apache-Regeln von Hand zu schreiben. Der Generator läuft im Browser und lädt nichts hoch. Die Beschriftung der Schalter ist Englisch, die Regeln selbst auch.
So nutzen Sie ihn
WordPress nutzt .htaccess für Permalinks auf Apache und LiteSpeed. Dieselbe Datei kann den
Zugriff auf empfindliche Dateien stoppen, bevor WordPress lädt. Nginx liest sie nicht.
- 1. Wählen Sie die Regeln. Die Vorgaben sind ein brauchbarer Start.
- 2. Kopieren Sie die Regeln und setzen Sie sie über
# BEGIN WordPress. Den WordPress-Block lassen Sie stehen. - 3. Hochladen und prüfen. Bewahren Sie eine Kopie auf, falls der Server 500 antwortet.
4 protections. Paste above the WordPress block.
Apache 2.4 or LiteSpeed with mod_authz_core. Nginx ignores this file. Backup first. Paste above # BEGIN WordPress and leave that block alone.
Downloads as htaccess.txt. Paste above # BEGIN WordPress. Rename to .htaccess in the WordPress root.
# Generated by WP Security Ninja # https://wpsecurityninja.com/tools/htaccess/ # Paste above # BEGIN WordPress. Leave that block alone. # Backup your current .htaccess first. <Files "wp-config.php"> Require all denied </Files> <FilesMatch "^\.ht"> Require all denied </FilesMatch> Options -Indexes
Second file: wp-content/uploads/.htaccess
Put this file in wp-content/uploads/ as .htaccess.
# Generated by WP Security Ninja # https://wpsecurityninja.com/tools/htaccess/ # Place this file at wp-content/uploads/.htaccess <FilesMatch "\.php$"> Require all denied </FilesMatch>
After you upload
Backup first. Then check these in the browser. A 500 means restore the old file over SFTP.
- Homepage, a post, and /wp-admin/ still load.
- yoursite.com/wp-config.php must not show PHP.
- yoursite.com/wp-content/ must not list files.
- If the site returns 500, restore the backup over SFTP.
Wer die Datei nicht anfassen will, lässt die Cloud Firewall und die Sicherheitstests im Plugin laufen.