How can i redirect my site to another url using htaccess?

You can redirect your complete site (when someone type your domain) to another URL, placing the following lines in your .htaccess file in your public_html directory:


RewriteEngine on
RewriteCond %{HTTP_HOST} ^$ [OR]
RewriteCond %{HTTP_HOST} ^$
rewriterule ^(.*)$ [R=301,L]


This will not follow the path, which means anything you type after the domain will always redirect to the new url. For example, someone typing will redirect to


If you wish it follow the path, for example if someone type redirect to, please check the Domain Redirection section in you cPanel, you can easily set it up that way from there.

  • 5 Users Found This Useful
Was this answer helpful?
Related Articles
Copyright © 2020 PlusPlusHosting.Net. All Rights Reserved. is an authorized reseller of goods and services provided by PlusPlusHosting.Net.