So basically I have a site where occasionally I setup a "vanity" url for web campaigns or product literature:
i.e.
http://www.example.com/campaign-URL
links to the same page as
http://www.example.com/normal-site-URL
I set this up with a rewrite in IIS7, and as such, it's difficult to grab the real URL from the underlying ASP.NET code since Context.Request.Url returns the rewritten URL instead of the URL the user visited. This makes it difficult to inject the <link rel="canonical"
tag into the page at render time.
Instead, what I've done is to check the URL through JavaScript and inject the <link rel="canonical"
tag that way.
Honestly, I don't think it ultimately will make much of a difference since the preferred URL is already submitted through the Google Sitemap, but since I have some SEO folks that are demanding it, I'm wondering if this will be picked up by Google or if I'm just wasting my time adding that code.
Thanks!