Add a Redirect Script to your .htaccess File Print

  • 0

This support article walks you through the process of adding a redirect to your .htaccess file.  You can use this script to redirect your site to www.domain.com or to a different domain altogether.

  1. Add the following code to your .htaccess file:

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

Replace domain.com and www.domain.com with the your domain name and the destination URL respectively.

Upload the .htaccess file to your web root or another appropriate directory.

Was this answer helpful?

« Back