I have changed my domain and want to forward visitors to the new one

I have changed my domain and want to forward visitors to the new one

To ensure your new primary domain name is used, you should first park the previous primary one as shown in this tutorial and then redirect the old domain name to your new one by inserting this code to the .htaccess file in your public_html folder (you … Continued
How to allow/deny access to your website based on the visitor’s browser?

How to allow/deny access to your website based on the visitor’s browser?

Using Apache .htaccess rules you can deny a visitor depending on his/her browser identification. For example to deny Opera browser accessing your site you can use the following rules: 1 2 3 BrowserMatchNoCase opera bad_browser Order Deny,Allow Deny from env=bad_browser If you … Continued
How to redirect all visitors except your IP to another website?

How to redirect all visitors except your IP to another website?

To redirect everyone but you to another website, you should add this code to your .htaccess file: 1 2 3 4 RewriteEngine On RewriteBase / RewriteCond %{REMOTE_HOST} !^1.2.3.4 RewriteRule .* http://www.anothersite.com [R=302,L] You can create/edit the .htaccess file using File Manager in cPanel, … Continued
How to make a rewrite rule time-dependent?

How to make a rewrite rule time-dependent?

You can easily make an .htaccess rewrite rule time-dependent. To do this, you should add the following line before the rewrite rule you wish to make time-dependent: 1 RewriteCond %{TIME_HOUR} ^09 This way the rewrite rule following the condition will be executed … Continued
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