Why a password-protected directory asks twice for the password?

Why a password-protected directory asks twice for the password?

Usually the reason for this is that you have password-protected a subdirectory on your site. In the same time in the webroot there is another .htaccess file with other Apache directives and this confuses the webserver to ask twice for the password. … Continued
URL Masking with .htaccess

URL Masking with .htaccess

The following method will allow you to mask certain part of your website’s address. For example, when someone opens up: http://yourdomain.com/something the actual content that will be displayed can be the one under: http://yourdomain.com/something/else although the URL in the visitor’s … Continued
How can I enable Mod-Rewrite Module?

How can I enable Mod-Rewrite Module?

You can enable mod_rewrite by adding the following line in the .htaccess file of your website: RewriteEngine On After that line you should place your custom rewrite rules. For example if you wish to redirect your domain to an HTTPS connection you should place … Continued
How to prevent directory listing?

How to prevent directory listing?

By default, if you don’t have an index file in a web accessible folder, when accessed through a browser, its contents will be listed. In order to secure additionally XonHost shared servers, they were patched to disallow directory listing out … Continued
How to redirect non-www URLs to www?

How to redirect non-www URLs to www?

You can redirect all of the requests for yourdomain.com domain to www.yourdomain.com by modifying your website’s .htaccess file. You need to add the following lines at the beginning of the file in order to setup that redirection: 1 2 3 RewriteEngine On RewriteCond %{HTTP_HOST} … Continued
How can I redirect mydomain.com to mydomain.com/folder?

How can I redirect mydomain.com to mydomain.com/folder?

You can redirect mydomain.com to mydomain.com/folder by logging in your cPanel and opening the Redirectstool. Then use the Add Redirect section to create the desired redirect and click the Add button to apply it. In case you have doubts we recommend using the Permanent redirect … Continued
How to redirect www URLs to non-www?

How to redirect www URLs to non-www?

You can redirect all of the requests for www.yourdomain.com domain to yourdomain.com by modifying your website’s .htaccess file. You have to add the following lines in the beginning of the file so that the redirection is properly set up: 1 2 3 RewriteEngine On … Continued
My redirection set from cPanel shows an error

My redirection set from cPanel shows an error

When having problems with such redirection, log in your cPanel, go to the File Manager and navigate to the directory in which you’d like to set the redirection. Then rename the file .htaccess to htaccess. This will disable any previous redirection / rewrite rules which might … Continued
How to run simple shell scripts directly from a browser?

How to run simple shell scripts directly from a browser?

To be able to run shell scripts directly from the browser, you should add this rule to your .htaccess file: Options +ExecCGI AddHandler cgi-script .sh This tells the web server to treat .sh files as CGI scripts. To test this, let’s try … Continued