htaccess Generator Tool - Generate htaccess code

Our htaccess generator tool can generate the following htaccess codes, deny all access to files,basic authentication , error page, default page, setup WWW, redirect directives & htaccess access restriction.


.htaccess Generator Tool

Generate your htaccess codes with htaccess Generator Tool

With our .htaccess generator tool you can generate the following .htaccess codes; .htaccess deny all access to files, .htaccess basic authentication, .htaccess error page, .htaccess default page, .htaccess setup WWW, .htaccess redirect directives & .htaccess access restriction. To use our htaccess generator tool is very simply just select the htaccess section you require and fill it in and your code will appear at the bottom of the page, if you need all the htaccess codes just fill in all fields. We also have some other free htaccess tools; htaccess ban generator which will enable you to ban any user, htaccess password generator will help you to create .htpasswd file to protect any directory and finally our free htaccess url rewrite which will enable you to Convert dynamic URLs into static html search engine friendly links.

.htaccess deny all access to files | htaccess basic authentication | .htaccess error page | .htaccess default page | .htaccess setup WWW | .htaccess redirect directives | .htaccess access restriction

.htaccess Deny all access to files

We would strongly recommend choosing "Deny(Y)" if you do not have any particular reason.

.htaccess Basic Authentication

.htaccess Basic authentication will enable you to password protect one or more directories with Basic HTTP Authentication using .htaccess. A .htpasswd file will be used to store login details.

STEP 1 Create your .htpasswd

User name





Create a file called ".htpasswd" and copy& paste the texts above to file.

STEP 2 Enter the path to the .htpasswd file(e.g.:/home/foo/bar/.htpasswd)

.htaccess Error Page

.htaccess error page will enable you to setup your custom error pages using htaccess. Create a page just like any other, with a message like 'sorry, the page you are looking for cannot be found' (404) or 'there is a problem running this page' (500). Upload your custom pages to your website and use the generator below to create the code to place into your htaccess file.

Enter URLs or paths



Bad Request



Authorization Required



Payment Required






Not Found



Method Not Allowed



Not Acceptable



Proxy Authentication Repid



Request Time Out



Conflicting Request






Content Len Required



Precondition Failed



Entity Too Long



URI Too Long



Internal Server Error



Not Implemented



Bad Gateway



Service Unavailable



Gateway Timeout



HTTP Version Not Supported

.htaccess Default Page

.htaccess default page will enable you change your default directory page with the Directory Index command. So what's a default directory page? When a URL or directory is requested a default page is loaded. For example if you go to it will serve up the default page which is index.html because our default page is index.htm, .html or .shtml. Using the Directory Index command allows you to change your default page to anything you wish like "thisismydefaultpage.htm"

Enter file name e.g.(index.html)

.htaccess Setup WWW

.htaccess Redirect Directives

.htaccess Redirect directives will enable you to redirect some URL and/or page on your site to another one. The feature is very useful if you have recently redesigned your site but you wish to keep the old addresses working for various reasons (you have links to these pages from other sites, some users may have the old pages bookmarked, etc). The Apache web server provides several way for setting up redirects. The most simple one is using the “Redirect” directive.

Enter the site path into "From" and URL into "To"

301 Moved Permanently

  • From:  To: 
  • From:  To: 
  • From:  To: 

302 Moved Temporarily

  • From:  To: 
  • From:  To: 
  • From:  To: 

.htaccess Access Restrictions

.htaccess Access restrictions will enable you to allow or restrict certain pages within your website.

Enter allowed addresses

  • OK: 
  • OK: 
  • OK: 
  • OK: 
  • OK: 
  • OK: 
  • OK: 
  • OK: 

Enter denied addresses

  • NG: 
  • NG: 
  • NG: 
  • NG: 
  • NG: 
  • NG: 
  • NG: 
  • NG: 

Copy & Paste the texts above to the .htaccess file.
If you do not have .htaccess file, use notepad to create one,
copy and paste the text below into notepad editor and Save As .htaccess


Support our Webmaster Tools

Our webmaster tools are completely free to use however, they require time & money to maintain.
Each query uses our server's resource so feel free to donate towards our free services.
You can donate in two ways:

A- by donating any amount of money using Paypal or
B- by adding a small link or banner to your website.
Please support us by linking to our website

Please note: Donations will help our team to develop new tools & keep existing tools running efficiently.