Category Archives: htaccess

dell_1

Domain redirect

If you wish to redirect domain name i.e if you access abc.con and wich to redirect domain to xyz.com then you will need to create .htaccess file under document root of domain and add following.

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^abc.tld [nc] # Domain to redirect
rewriterule ^(.*)$ http://xyz.tld/$1 [r=301,nc]


contact@webhostingsupport.info

Post to Twitter

rack_1

How to disable mod_security for domain

If mod_security is causing problem in proper functuning of your web site then you will need to disable it by placing few statements into your .htaccesss file. Statement verry depending on your apache server version.

Checking apache version:

[root@server]# httpd -v

OR

[root@server]#/usr/local/apache/bin/httpd -v

If you have apache 1.x then create .htaccess file into your document root and place following statements.
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

If you have apache 2.x then place following statements.
<IfModule mod_security2.c>
SecRuleEngine Off
SecAuditEngine Off
</IfModule>
That’s it your are done.


contact@webhostingsupport.info

Post to Twitter

grass_1

Enable/Disable directory listing

If you want list all the file that are present under certen directory then you will need to enabled directory listing that be be done in your .htaccess file as fallows.

1) Edit your .htaccess file and put following code

Options +Indexes

2) save and exit. Now you are done.
Eg: http://yourdomain.com/test

All files under testdirectory will be listed into browser.

If you want to disable it then enter following line in .htaccess

Options -Indexes


contact@webhostingsupport.info

Post to Twitter