Pick a URL For your site

Discussion in 'Search Engine Optimization' started by dmmhmarketing, Jun 3, 2010.

  1. #1
    Search engine still (and they are meant to be ohh so clever...) see http://yourdomain.com and http://www.yourdomain.com as two sites!!

    I'm going to be brave and make an asumption that many of you are backlinking.. do you ALWAYS check to make sure your links are going to the same *site* ?

    I know I dont.. and even if you do can you be sure that others linking to you link to the site you want them too?? I doubt it.

    I get around this with a little .htaccess code.. its very simple.

    Redirect yourdomain.com to www.yourdomain.com:

    RewriteEngine on (ONLY if it's not already there)
    
    RewriteCond %{HTTP_HOST} ^yourdomain.com
    RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]
    Code (markup):
    or

    Redirect www.yourdomain.com to yourdomain.com:

    RewriteEngine on (ONLY if it's not already there)
    
    RewriteCond %{HTTP_HOST} ^www.yourdomain.com$ [NC]
    RewriteRule ^(.*)$ http://yourdomain.com/$1 [R=301,L]
    Code (markup):
    Simples

    If like me you have many WP blogs then all you do is add the last two lines to the end of your WP .htaccess like this:

    WP .htaccess:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    RewriteCond %{HTTP_HOST} ^yourdomain.com
    RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]
    </IfModule>
    
    # END WordPress
    Code (markup):
    Enjoy :)
     
    dmmhmarketing, Jun 3, 2010 IP
  2. sem.expert

    sem.expert Banned

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    Yes dmmhmarketing, Search engine treat as two sites. So always redirect your site url and make only one url for one page.
     
    sem.expert, Jun 3, 2010 IP