Skip to main content
To send traffic from an old hostname to a new one, edit .htaccess in the site root (often public_html for the primary domain). Create the file if it does not exist—the name starts with a dot. Add:
<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{HTTP_HOST} ^(www.)?olddomain.com [NC]
    RewriteRule (.*)$ https://newdomain.com/$1 [R=301,L]
</IfModule>
Replace olddomain.com and newdomain.com with your domains. The ^(www.)? part matches both www and non-www; keep the ? as shown.
Last modified on June 4, 2026