简体   繁体   中英

canonical tag and file extensions

I was just wondering, I use a .htaccess script to strip the file extensions from my URL's

Would the canonical tag, which is the direct URL you want to user to see contain the file extensions for example;

 mysite.co.uk/locations/regions/thislocation.html

Example of how my actual url would look;

    <link rel="canonical" href="http://mysite.co.uk/locations/regions/thislocation"/>

Would the canonical tag be set up with the above URL or with the file extension?

规范URL应该表示您希望用户访问的URL(并在其地址栏中查看),而不是仅作为您的实现的副作用存在的URL(其重点是停止 .html版本被索引)搜索引擎)。

@anubhava You have to setup a canonical tag without extension.Because google crawls a URL which shows in you Header.

therefore Link will be : <link rel="canonical" href="http://mysite.co.uk/locations/regions/thislocation"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM