WordPress.org

Ready to get started?Download WordPress

Forums

Broken Link Checker
#anchors cause 404 OK error and truncated URL (15 posts)

  1. Jamil Jonna
    Member
    Posted 3 years ago #

    Hello,

    A while back someone mentioned this issue and it never got resolved. I have thousands of anchor links in my posts because it is an online journal with footnotes. Nearly all the notes are in the form:
    <a href="#en5">5</a> corresponding to <a href="#fn5">5</a>. Oddly, every single one of my anchor links appears in Link Checker with a 404 OK message. I noticed that the name of the post is stripped out of the URL in Link Checker:

    http://monthlyreview.org/_beta01/blog/magazine/1997/09/01/between-nuremberg-and-amnesia-the-truth-and-reconciliation-commission-in-south-africa#fn1
    becomes
    http://monthlyreview.org/_beta01/blog/magazine/1997/09/01#fn1

    The latter takes me to the September 1, 1997 archive pages and obviously anchors to nothing. Why does this happen and can it be fixed?

    Thanks.

  2. Janis Elsts
    Member
    Plugin Author

    Posted 3 years ago #

    Ugh, can't believe I missed that #anchor parsing bug. The dev. version will have the fix within an hour or so:
    http://downloads.wordpress.org/plugin/broken-link-checker.zip

    If that works for you, I'll include it in the next official release.

    The "404 OK" thing is a separate problem and probably somehow related to the fact that your site requires authentication. The plugin is designed to report links that require auth. as working. The rationale is thus: if there's something at the target URL that's capable of issuing an authentication challenge, that something is probably working fine.

    However, the above shouldn't cause the plugin to display the 404 code (it should show "401 OK" instead). Is your authentication system set up to let the plugin through automatically or some such?

  3. Jamil Jonna
    Member
    Posted 3 years ago #

    I don't have a way of letting the plugin 'through' that I know of. As can be seen, this is a beta version. I could remove the protection and see what happens so I have an idea when the site goes live. Also, I'll install the dev version and get back to you as soon as I can.

    Also, I was just wondering. If I get the pro version, can it also make plain text links active as well? I know that I can check them, but it would be useful to make them active also.

    I just realized that the form of the notes is slightly different than above, if that makes any difference...
    <a id="fn5" href="#en5">5</a> corresponding to <a id="en5" href="#fn5">5</a>

  4. Janis Elsts
    Member
    Plugin Author

    Posted 3 years ago #

    Installing the Pro version won't make text links active. However, I'm pretty sure there is a plugin somewhere out there that can do it. WP already does it automatically for comments, so theoretically you would just need to apply the same code to posts.

    Also, having an "id" attribute in the link tag makes no difference. The plugin only cares about "href".

  5. Jamil Jonna
    Member
    Posted 3 years ago #

    Unfortunately the beta version breaks my site. I'll see if I can get a console message...Nope, sorry. I couldn't find any messages just yet. Please let me know if you come up with another release.

  6. Janis Elsts
    Member
    Plugin Author

    Posted 3 years ago #

    Err, I will of course need to know how it breaks your site to make sure the next release doesn't do the same thing...

  7. Janis Elsts
    Member
    Plugin Author

    Posted 3 years ago #

    Scratch that, found the problem. Should be fixed now.

  8. Jamil Jonna
    Member
    Posted 3 years ago #

    Wonderful, when you have the new version ready, I'd be happy to test.

    I know this has absolutely nothing to do with your plugin but I'm also using Redirection with my site and something is happening that is most likely easy to fix. Whenever I try and redirect a URL with a .php extension, it simply doesn't work. URLs with .htm or .html extensions work fine but .php redirects simply break. Do you happen to know if have to use RegEx to redirect these files?

    redirect source: /_beta01/598einst.php
    redirect: /_beta01/blog/magazine/1998/05/01/why-socialism-2

    error:
    You've submitted a request for a file that does not exist on this server. Please correct your URI and try, try again. (none) 71.193.180.187 /_beta01/598einst.php monthlyreview.org Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 404

    Many thanks ahead of time...

    J

  9. Janis Elsts
    Member
    Plugin Author

    Posted 3 years ago #

    New version is up; same link as before.

    I'm not familiar with the Redirection plugin, so I can only guess why .php redirects don't work. Perhaps there's something in your .htaccess that makes the server treat them differently than other links?

  10. Jamil Jonna
    Member
    Posted 3 years ago #

    thanks, the new version works again. there are still a whole bunch of 401 OK messages but the URLs are at least correct.

    http://monthlyreview.org/_beta01/blog/magazine/2010/07/01/latin-america-twenty-first-century-socialism-inventing-to-avoid-mistakes-2#en209
    401 OK
    Latin America

    etc.

    I guess it really doesn't cause any problems. It is just annoying.

    Oh, and I tried eliminated everything from the .htaccess file already, thinking it had something to do with my network installation. But that didn't help.

  11. Janis Elsts
    Member
    Plugin Author

    Posted 3 years ago #

    Those 401's should go away on their own once you remove the password protection.

  12. teknath
    Member
    Posted 3 years ago #

    what theme does this monthlyreview.org use, looks pretty good! Could you tell me that pls?!

  13. Jamil Jonna
    Member
    Posted 3 years ago #

    I use the ThemeHybrid's Prototype theme. I definitely recommend it. also, the warnings did go away. thanks!

  14. teknath
    Member
    Posted 3 years ago #

    Thanks a lot Jamil,
    Hope to get it with 3 columns, sidebar left, main content:center and right sidebar! and hopefully we can change the background color and header type too!
    Thanks a lot once more!

  15. Jamil Jonna
    Member
    Posted 3 years ago #

    make sure to read the theme documentation because it actually uses filters to modify the column layout. I.e., you can set the layout conditionally. In addition, the theme adds a radio button set with several layout type options so you can customize each page/post individually. Really, Hybrid is the best theme out there because Justin Tadlock is so involved in the WordPress community. I highly recommend buying a support package for his site.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic