- Home ›
- Button FAQs ›
- “URL points to wrong story” Diagnosis
“URL points to wrong story” Diagnosis
There are currently a large number of users reporting issues with their retweet buttons, where on either all of their pages or some of their pages they are getting the message “URL points to wrong story”.
Please read and perform all the checks in this post before posting that you are experiencing this issue, as it is more often than not a configuration problem on a certain aspect of your site.
Diagnosis
All of the problems I have seen with this issue relate to canonical URLs.
Canonical URLs are usually used for SEO purposes. You can read more about canonical URLs courtesy of Google here.
The majority of problems are when the path section of the canonical URL is being either encoded incorrectly, lowercased, or all the canonical URLs point to one page.
Problem 1: All canonicals point to a single destination
For example, if you have all your canonical URLs set to point to your home page, when you try and tweet from any other page, it will fail. To resolve this, you should update your code or canonical URL plugin’s configuration so that it does not point all the canonical URLs on your site to your homepage. This will solve the “URL points to wrong story” error.
Problem 2: Canonical URL path case
A second example is a correctly encoded path may contain the character “%E2″ – often found in blog post titles when powered by WordPress. However, if you (or the plugin you are using to generate canonical URLs) is lowercasing the path, this will be transformed to “%e2″, which (by definition of the URL RFC) changes the address that the URL points to (paths in URLs are case sensitive). This will confuse the system we use to verify that the short URL in the post is valid, and will cause the “URL points to wrong story” error.
Problem 3: Canonical URL path encoding
A final example is that the path is being incorrectly encoded. For example, a page’s URL may have two query parameters, /?p=123&lang=en (which is a pretty common one). The problem arises when the path is encoded when it should not be, resulting in the canonical URL having an encoding such as this: “/?p=123&lang=en”. This is of course completely different to the page’s original URL, which will again confuse the short URL verifier and cause the “URL points to wrong story” error.
Solutions
If you are comfortable working with your canonical URLs, or you are building the canonical URLs yourself, you can solve this problem by checking that the canonical URL on the page exactly matches that of the page’s URL. If it does not, correct the generating script to ensure that it is encoded correctly.
If you are using a WordPress or similar plugin to generate your canonical URLs (a lot of so-called “SEO” plugins do this) then contact the creator of the plugin to ensure that their canonical URL generation code does not cause the canonical URL to differ from that of the page’s URL.
If you have performed all these actions and checked that your canonical URLs are working correctly, please post in this forum with a link to the exact page that you are having issues with – this allows us to quickly debug a large number of issues – and the name of any SEO-related plugins you are using.



(18 votes, average: 3.83 out of 5)