Tool Categories

.htaccess Generator
3 rules enabled across all sections
Security Rules
Protect your site with access control and hardening rules
1 / 4
Directory Listing
Prevents directory listing and sets default index files
Options -Indexes
DirectoryIndex index.php index.html
IP Blocking
Block specific IP addresses while allowing others
Order Allow,Deny
Deny from 192.168.1.1
Allow from all
Password Protection
Protect directories with password authentication
AuthType Basic
AuthName "Restricted Area"
AuthUserFile /path/to/.htpasswd
Require valid-user
Hotlink Protection
Prevent other websites from hotlinking your images
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
Generated .htaccess
11 lines of code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Directory Listing
Options -Indexes
DirectoryIndex index.php index.html

# Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Gzip Compression
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
</IfModule>