IP Canonical issue

Discussion in 'SEO' started by kevincook, Apr 2, 2012.

  1. #1
    is this necessary to redirect ip to domain. Can it harm the ranking of a website..if yes then to how extent...
     
    kevincook, Apr 2, 2012 IP
  2. www.seotest.com

    www.seotest.com Well-Known Member

    Messages:
    77
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    168
    #2
    you can make this in htaccess in directory where is ip linked in apache (or by easy php in same directory)


    this is combination of both
    change files in dir linked by apache for ip

    .htaccess

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>


    index.php
    <?
    if($_SERVER['HTTP_HOST']=="11.11.11.11") {
    $url="http://www.domain.com".$_SERVER["REQUEST_URI"];
    header("Location: $url");
    exit;
    } ?>
     
    www.seotest.com, Apr 2, 2012 IP