• Resolved PeterC66

    (@peterc66)


    I like BLC and it has proved useful in the past.

    However, on my WAMP test system all my links seem fine, but BLC is seeing some links that start /wp/wp-content/uploads as //localhost-content/uploads (i.e. missing out /wp/wp) and therefore reporting them as broken (Server not found). Other similar links it is seeing as //localhost/wp-content/uploads (i.e. missing out wp/) and reporting them as 404 Not Found.

    I notice that something similar, but not identical has happened on my live site. Links that are /wp/wp-content/uploads… are seen by BLC as https://www.hcnhistory.org.uk/wp-content/uploads… (i.e. missing out wp/) and reported as 404 Not Found.

    I do not remember having this problem a few months ago when I last examined the site. Does BLC have problems with relative addresses?

    https://www.ads-software.com/plugins/broken-link-checker/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Usually relative addresses work fine. However, they could cause problems if you’re using a plugin or server configuration that dynamically changes the site URL. Depending on the setup, the site URL that BLC sees might not match the URL you see in the browser, causing BLC to resolve relative addresses incorrectly.

    Are you using any domain mapping, site redirection, URL filtering or similar plugins?

    Edit: Also, plugins that change post permalinks or image URLs.

    Thread Starter PeterC66

    (@peterc66)

    Thanks for the prompt reply. A short answer is that I do not know, but I am not aware of doing so. I have managed to do quite a bit with my WP set-up but I do not fully understand WP, or even the terminology.

    If you are willing to explore in more detail, there is a list of the plugins I use at https://www.hcnhistory.org.uk/technical/ under the tabs Major WordPress Plugins Used and Minor WordPress Plugins Used. Not all are enabled in the production site, nor on my WAMP.

    I do not know if it is relevant, but in terms of folder structure my WordPress Address is the Site address followed by /wp, and the software I have integrated with WP (TNG) is at /tng.

    Thanks for your help, and for such a useful plugin.

    If you are willing to explore in more detail, there is a list of the plugins I use at https://www.hcnhistory.org.uk/technical/ under the tabs Major WordPress Plugins Used and Minor WordPress Plugins Used.

    Nothing on that list looks immediately suspicious, though there are some plugins that I’m not familiar with. Of course, one could do pretty much anything with the “Insert PHP” plugin, but I assume you’re not using it to generate post/image/link URLs.

    Lets try a different approach. Could you post the source code of a few of the links that BLC is incorrectly reporting as broken, as well as the permalinks of the posts/pages that contain those links? Please post the code/permalinks as they show up in the post editor, not the final result that site visitors would see.

    Thread Starter PeterC66

    (@peterc66)

    I am not quite sure if I have understood what you are asking for, but I will have a go. The problem I reported before is on my WAMP system on my laptop which is of course not accessible to others, but these are from my production site..

    One of the links that BLC reports as 404 Not Found:
    1a) is reported as https://www.hcnhistory.org.uk/wp-content/uploads/BeansOnToast.jpg
    1b) The Permalink of the page the link is on is https://www.hcnhistory.org.uk/chatters/
    1c) The source for this link is <img src=”/wp/wp-content/uploads/BeansOnToast.jpg” alt=”Beans on Toast” style=”margin-right: 5px;” />

    Another link that BLC reports as 404 Not Found:
    2a) https://www.hcnhistory.org.uk/wp-content/uploads/table-images/D01403c_0400.jpg
    2b) The Permalink of the page the link is on is https://www.hcnhistory.org.uk/roads/ ?
    2c) The source for this link is <img alt=”Two roads to Holywell” src=”/wp/wp-content/uploads/table-images/D01403c_0400.jpg” width=”100″ />

    Thanks again
    Peter

    Thank you for the examples. The code is fine, and the permalinks also look correct. I added it to a local site to see how the plugin would handle the images, and (unfortunately) it parsed the URLs correctly.

    I still suspect it’s some kind of a plugin conflict, but checking for that can be time-consuming. Perhaps you could try it on your test site.

    Here’s how: first, deactivate all plugins except BLC and switch to the default theme. Then make a small change to one of the pages that contains a relative link. This will make BLC re-scan that post for new links. Check whether it now reports the link correctly. If yes, reactivate one of the other plugins and edit the page again, waiting for BLC to finish checking it each time. Continue reactivating plugins one by one until the problem re-appears.

    In addition to that, try installing the debug version of BLC:
    https://downloads.www.ads-software.com/plugin/broken-link-checker.zip

    This version includes some additional logging features that could help identify the source of the problem. You’ll need to turn on logging under Settings -> Link Checker -> Advanced. Then edit one of the pages (as above) and check the log file for messages that say “resolving relative URL”.

    Thread Starter PeterC66

    (@peterc66)

    Problem solved! I had tried getting BLC to recheck the supposed errors, but it had made no difference. So I used your suggestion and made a minor change to a page – and the errors on that page disappeared. This was all without deactivating any plugins etc.

    This led me to find the “nuclear option” under the advanced tab and forced a complete recheck from scratch – all the spurious errors disappeared! I did this on both the WAMP and production site. My problem is therefore solved, but it is still a mystery how those odd links got picked up and why BLC did not correct them during a routine recheck.

    I have added the complete recheck from scratch to my list of things to do when bug-fixing. Thanks again for your help, and especially so promptly.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘/wp/wp-content/uploads.. is seen by BLC as //localhost-content/uploads’ is closed to new replies.