1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fastest way to fix 1000s of broken links in HTML file

Discussion in 'General Programming Chat' started by MetalMan390, May 6, 2014.

  1. MetalMan390

    MetalMan390 Regular Member

    Joined:
    Sep 26, 2009
    Messages:
    285
    Likes Received:
    18
    I have a website that has, spread throughout about 15 pages, about 7500 hyperlinks. I have combined all links to one php file and uploaded it to my server so that I could check all backlinks at once (used Xenu). Of these links, about 35% are dead. Most of these dead links (1900+) are listed as "not found". I did some poking around with the links manually, and some of the "not found" links can be "fixed" by deleting the trailing directory/path within the URL or by reverting to the TLD. Some of the sites though and of course there is no saving these links.

    I would like to fix as many of these links as I can in the fastest way possible. I don't want to spend a week going through thousands of links, manually "adjusting" the URL of each site, and deleting the links belonging to dead sites.

    Anyone have any ideas on how I can accomplish this? Maybe regex and scrapebox? I am not good with regex though...