How to redirect my error pages to an URL?

How to redirect my error pages to an URL?

In case you don’t want to use custom error pages and you prefer to redirect them to another website or to your home page, you can use the ErrorDocument directive to achieve this. For example, if you wish to redirect the 404 … Continued
Cross-origin resource sharing (CORS)

Cross-origin resource sharing (CORS)

CORS is a security system that allows restricted resources like JavaScript code, fonts etc. on a web page to be requested from a 3rd party domain outside the domain from which these resources were served. Supporting CORS from the server helps … Continued
How to change the timezone for my account?

How to change the timezone for my account?

You can change the timezone for your account or for a specific folder by adding this rule to your .htaccess file: SetEnv TZ Timezone For example, if you wish to change the timezone to America/New_York, you should add this line to your .htaccessfile: … Continued
How to force SSL with .htaccess

How to force SSL with .htaccess

You can force an HTTPS connection on your website by adding these rules in your website’s .htaccess file: 1 2 3 RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] The .htaccess file needs to be located inside the site’s … Continued
How to block access to all hidden files on your account?

How to block access to all hidden files on your account?

Files or folders starting with a dot are usually Linux system files. For Security precautions it is recommended to disable all direct web access to them. To do this, you can add the following lines inside the .htaccess file in the public_html folder: 1 … Continued
Redirect from HTTPS to HTTP

Redirect from HTTPS to HTTP

There are some specific situations when you want to redirect particular website to be opened through HTTP instead of HTTPS. To do so you can add the following directives in your website’s .htaccess file: 1 2 3 # Redirect HTTPS … Continued
How to block access to a specific folder?

How to block access to a specific folder?

To block all access to a specific folder in your account, you should add this rule to the .htaccess file in that folder: Deny from all If the .htaccess file does not exist, you can easily create it from your … Continued
How to change my document root folder using an .htaccess file?

How to change my document root folder using an .htaccess file?

By default your main website is loaded from the public_html folder of your account. The public_html directory is also called web root folder or document root folder. If you would like to keep your site’s files in a sub folder of the public_html, and … Continued
How to password protect a single file?

How to password protect a single file?

The easiest way to password protect a single file is to place it in a folder of its own and then follow the steps here to protect with a password the entire folder. Alternatively you can only protect a single file in … Continued
How to edit hidden/system files?

How to edit hidden/system files?

In the Linux operating system, a hidden file is any file that begins with a “.” (dot). An example for such a file is .htaccess. Such hidden files can be edited in two ways: Using File Manager in cPanel. After you click on … Continued