RewriteEngine On
RewriteBase /
# Allow your IP
RewriteCond %{REMOTE_ADDR} !^000\.000\.000\.000
# Redirect to maintenance.html
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
RewriteRule ^(.*)$ http://example.com/maintenance.html [R=307,L]
# Compression
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip
# Block some IP 000.000.000.000
RewriteCond %{REMOTE_HOST} 000.000.000.000 [OR]
# Custom error pages
ErrorDocument 400 /error/400.html
ErrorDocument 401 /error/401.html
ErrorDocument 403 /error/403.html
ErrorDocument 404 /error/404.html
ErrorDocument 500 /error/500.html
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
# Remove .php extention
RewriteRule ^([^\.]+)$ $1.php [NC,L]
# Remove .html extention
RewriteRule ^([^\.]+)$ $1.html [NC,L]