1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How Solve Canonical Issue With Htaccess File?

Discussion in 'Search Engine Optimization' started by Sachinsood90, May 19, 2016.

  1. #1
    How can i use this file htaccess file to resolve canonical issue, please tell me.
     
    Sachinsood90, May 19, 2016 IP
  2. nosheen hayat

    nosheen hayat Banned

    Messages:
    56
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    33
    #2
    First you need to know about your site have which types of server. Mostly these types of server use a htaccess file:
    1- Linux , 2- Apache
    if your hosting account use one of these type of server then you can coply below code at your htaccess file.

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^ example.com [NC]
    RewriteRule ^(.*)$ http://www.example .com/$1 [L,R=301]
    RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
    RewriteRule . http://www.example.com%1/%2 [R=301,L]
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(([^/]+/)*)index\.html\ HTTP/
    RewriteRule index\.html$ http://www.example.com/%1 [R=301,L]\

    Note: In red highlights, you need to replace example.com with your domain name and in green highlights, you need to replace with your .html or .php index page. Keep in mind do not write just index, write extension too.

    After copy this code with your htaccess old code, Save it and upload at your root folder where your site have index page. Hope it will solved.
     
    nosheen hayat, May 19, 2016 IP
  3. TomRider

    TomRider Greenhorn

    Messages:
    164
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    23
    #3
    I totally agree with everything thta nosheen hayat said.
    And would like to add that these are the most common hosting servers and are also the easiest to implement a permanent 301 redirect.
     
    TomRider, May 24, 2016 IP