Add a Redirect Script to your .htaccess File

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:

  2. 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.

  3. Upload the .htaccess file to your web root or another appropriate directory.
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Installing htop

htop is an interactive process viewer for Linux, which is a powerful alternative to the...

Bind Multiple IP Addresses to a Single Network Interface Card (NIC)

This tutorial demonstrates how to bind multiple IP addresses to a single NICI'll be using LAN...

Clear Memory Cache on Linux Server

By default the Linux OS has a very efficient memory management process that should be freeing any...

Set the time on a Linux server

Log into the server via SSHAt the shell prompt run the following command:date MMDDHHmmYYYYFor...

Check your disk usage in Linux

A good way to check your disk usage for folders on your Linux server is via shell.Download...