.htaccess Generator

The .htaccess is a file that can be placed in any directory of your website (normally the root directory) to give the Apache Web Server instructions such as how to respond to particular requests.

Using this .htaccess generator you can create rules for redirecting directories and files, define the locations for your error pages and prevent people from hotlinking to image files.


WWW Rewrite

Redirects yourwebsite.com to www.yourwebsite.com

Password Protect File

Requires .htpasswd file

htpasswd Generator

301 Redirect File Or Directory

Caching Javascript, CSS, And Images

Comma separated list. Omit leading “.”

Public Private
Must Revalidate

Prevent Hotlinking

The domain that is hotlinking to you.
Comma separated list. Omit leading “.”
What to show instead of the intended image. (optional)

Custom Error Pages (400, 404, 500, etc)

“Bad Request”
“Access Denied”
“File Not Found”
“Internal Server Error”

Block or Allow An IP Address

Comma separated list
Comma separated list

Change Default Directory Page

Block Bad Bots


Block Viewing .htaccess


Prevent Directory Listing


.htaccess Code

.htpasswd Code