Forum Moderators: phranque

Message Too Old, No Replies

301 redirect

         

hyperblack

9:47 am on Jul 8, 2005 (gmt 0)

10+ Year Member



hi,
the issue of 301 redirects to redirect [site...] to www.site and its importance has been discussed at large.

what is one best way as far as google is concerned for a site on apache server/cpanel to do it.i searched the forums and found several methods modrewrites,.htaccess entries, changing cname entries.

if somebody could illustrate the one best method for my case, i would be greatful and it would really help beginners like me.

thank you

ChadSEO

5:03 pm on Jul 8, 2005 (gmt 0)

10+ Year Member



If the server support both .htaccess files and mod_rewrite, the easiest way to do it is to put the following lines in a .htaccess file

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

[edited by: jdMorgan at 8:18 pm (utc) on July 8, 2005]
[edit reason] Examplified. [/edit]