Password Generator for .htpasswd


Htaccess Authentication

Protect one or more directions with Basic HTTP Authentication. Use the .htpasswd password generator and save the entries in the .htpasswd file.
AuthType Basic
AuthName "Basic Auth powered by internex"
AuthUserFile /path/to/.htpasswd
Require user exampleusername
In the .htpasswd just write the output from the Password Generator:
exampleusername:$apr1$8cah0v1u$TDjVh0

Htaccess Redirect

Redirect from old domain to new domain

RewriteEngine on
RewriteRule ^(.*)$ http://www.your-new-domain.com/$1 [R=301,L]

Redirect to www

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain.com [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]

Error Document

You can create custom error pages. See some examples below.
ErrorDocument 400 /400.html
ErrorDocument 401 /401.html
ErrorDocument 403 /403.html
ErrorDocument 404 /404.html
ErrorDocument 500 /500.html

Allow / Deny

Deny all requests and allow only from defined IP address.
Order deny,allow
Deny from all
Allow from xxx.xxx.xxx.xxx
Allow from xxx.xxx.xxx.xxx