OCS Solutions Web Hosting Design and Consulting Web Hosting and Consulting Call Us
OCS Home  |  Wiki Front Page  |  Web Hosting  |  Virtual Dedicated Servers  |  Consulting  |  Support  |  Contact Us

301 Redirect

From OCS Support Wiki

Jump to: navigation, search

Introduction

This guide will show you how to implement a 301 redirect. 301's are desired instead of domain aliasing for search engine reasons.

Prerequisites

  • The domain name must be pointing to our name servers, and you've told us to add it to our DNS system
  • You must have the domain added to the parked domains section in cPanel or in Webmin

Creating the Redirect

To create the redirect, edit or create a file called .htaccess in your public_html folder and add this to it:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^parked-domain.com [OR]
RewriteCond %{HTTP_HOST} ^www.parked-domain.com
RewriteRule ^(.*)$ http://www.main-domain.com/$1 [L,R=301,NC]

Replace parked-domain.com with the domain to redirect, and main-domain.com with your primary domain. Once you save the file, this will activate the redirect.

Personal tools
Navigation
Toolbox