How to Redirect all traffic to the root ?

asked Nov 23, 2012 in General by DinoGuy (2,130 points)
Hi all..

I want  to redirect all the traffic coming to a specific  URL on my  website to the root of my domain , I think it’s possible but  I am not sure how. If anyone knows please help me out.
Thanks in advanced.

1 Answer

0 like 0 dislike
answered Nov 23, 2012 by SmartHost (9,060 points)
Just copy the .htaccess  file to the root directory of your site, then add the following code inside the file (.htaccess)
RewriteEngine on
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) / [R=301,L]

Then save the file.