Online htaccess File Generator

Instructions

Fill the options and push "generate" button in order to get your .htaccess file.
Then copy and paste the content into your .htaccess file.
Remember, this file must be in the root of your site.


Public access options

Domain Example: domain.com (don't use www or http)
Redirect http to https (SSL)
Force www access (default is non www)

Config website

Prevent 404 errors for non-existing folders

Default access page Example: index.php index.html (default is index.html)
Default web charset Example: UTF-8
Force download (filetype) Example: .avi .pdf .mp4
Limit upload file size Example: 2147483647 (2GB)
Administrator email Example: webmaster@domain.com

Performance

Enable Gzip compression
Enable Keep-Alive header

Expires Headers
Example: 29030400
Time helper 30 min 1 hour 12 hours 1 day 1 week 1 month 1 year

Custom errors pages

Error 404 Example: error404.html
Error 500 Example: error500.html

Security

Prevent directory navigation
Disable CGI execution
Hide information about web server technology
Do not allow pages to be framed
Disable server sign
Block SPAM bots
Prevent illegal or unsafe access (restrictive mode)

Disallow script execution Example: .php .jsp .cgi
Deny requests methods Example: get|post|put
Prevent hotlinking Example: https://mydomain.com/mylogo.png


Generate .htaccess



Credits: based on Free htaccess generator by Emirodgar

  • apache, apache directives, web server
  • 4 Users Found This Useful
Was this answer helpful?

Related Articles

How to Create Sudo User on CentOS

This article provides step-by-step setup guide for adding Sudo user to CentOS system. The sudo...

How to Use Sudo

This article provides a guide to using a Sudo user on CentOS server. From the command line,...

Set Server Time Zones with Timedatectl

This article provides a guide to setting the server time and server time zone settings using...

htaccess RewriteRule Examples

Here are some useful mod_rewrite RewriteRule redirect examples that you can use in your .htaccess...

Using htaccess File to Block IPs

If your webserver is Apache, you may block access to your website from specific IP addresses...