Reputation: 556
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?
Upvotes: 1
Views: 463
Reputation:
@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"/>
Upvotes: 1
Reputation: 943615
The canonical URL should represent the URL you want the user to visit (and see in their address bar), not one that only exists as a side-effect of your implementation (the point of it is to stop the .html
version being indexed by search engines).
Upvotes: 2