This tool helps you create .htaccess and .htpasswd files quickly and conveniently.
What is .htaccess file?
Hypertext Access (also known as htaccess) is a file used to configure the web server. It is accepted by the server as a component and allows us to flexibly navigate and enable features, or to protect certain folders of a website.
What is .htpasswd file?
A .htpasswd file is typically used when protecting a file, folder or entire website with a password using HTTP authentication and implemented using rules within a .htaccess file.
Some applications of .htaccess files :
- Rewrite non-www to www/Remove www from URL
- Redirect http/https
- Redirect File or Directory
- Password protect file (requires .htpasswd file)
- Prevent Hotlinking
- Custom Error Pages (400, 404, 500, etc)
- Block or Allow an IP
- Block bots
- Change default directory page
- Prevent viewing of .htaccess file
- Prevent Directory Listing
- Enable gzip
Rules with .htaccess file
- You can use the # character to precede a line you want it to not run, ie switch that line to comment mode.
- The .htaccess file will work with the current directory and all subfolders of the current directory.
- If the .htaccess file fails to run, the result returns to the client will be 500 error.
So you have to be careful when editing it and before editing you should make a copy to use as a backup.
Errors that easily occur when using .htaccess file incorrectly
- 400 – Bad request
- 401 – Authorization Required (assword required for access)
- 403 – Forbidden
- 404 – Wrong page (page not found)
- 500 – Internal Server Error