Most Popular
Recently Added
Recently Updated

How do I redirect a domain name or page to a different location?

1. First park the additional domain name via the "parking" option in cPanel.
2. Locate the .htacces file in your public_html directory.
3. Add the following lines of text to the bottom of the text file:

SEO - 301 redirect format
Options +FollowSymlinks
RewriteEngine on
#This line below ensure https pages do not redirect
RewriteCond %{SERVER_PORT} ^80$
RewriteCond %{HTTP_HOST} !^www\.your_domain\.com$
RewriteRule ^(.*)$1 [L,R=301]

Web Page Redirection:
Redirect 301 /oldpage.html

Entire Site Redirection:
Redirect 301 /

Change File Extension to PHP:
RedirectMatch 301 (.*).html$$1.php

Redirect to always show non-www. version

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^
RewriteRule (.*)$1 [R=301,L]

Redirect to always show the www. version
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$$1 [L,R=301]

Redirect home page like index.php to directory:
Options +FollowSymLinks
RewriteEngine on
# index.php to /
RewriteCond %{THE_REQUEST} ^[A-Z]{3, 9} /.*index.php HTTP/
RewriteRule ^(.*)index.php$ /$1 [R=301,L]

This does not use .htaccess, but can be used as the text in a web page to redirect the page to another location in 10 seconds:
meta http-equiv=refresh content="10; url="


  • An excellent discussion on redirects with examples:

Properties ID: 000099   Views: 2370   Updated: 13 years ago
Filed under: