June 28, 2012 archive

Jun 28

Deny IP on .htaccess file

You can write rule to deny particular IP or range of IPs in .htaccess file. =============== order allow,deny deny from IP <– the IP you want to deny allow from all ===============

Jun 28

cPanel/WHM Autofixer

 The autofixer can be envoked two ways: /scripts/autorepair <script name> or in WHM:  https://example.com:2087/scripts2/doautofixer?autofix=test https://your.server.ip.here:2087/scripts2/autofixer (and enter the name of the script) http://httpupdate.cpanel.net/autofixer/ So for instance, if you wanted to repair a broken SSH configuration and you can’t access SSH on your server, there is a script called “safesshrestart” in the autofixer repository that you …

Continue reading

Jun 28

Redirect Subdirectories to the Root Directory using .htaccess

Suppose “block” is a sub directory in the domain “domain.com”, so you can redirect the sub directory to the root directory as follows. RedirectMatch 301 ^/block/$ http://domain.com/