Maintaining Your Site
The hardest part of maintaining any large Web site is making sure that all the pages have the appropriate links to each other. With a few hundred pages, it's easy to occasionally break a link or two, especially if you're like me and make minor changes by editing the HTML directly.
Link Verification
UltraDev has the capability to check all the links in your site in a few seconds. Choose the Check Links Sitewide from the Site menu. Three different check modes that it can operate in are Broken Links, External Links, and Orphaned Files. Each mode is useful, depending on what you're looking for.
Broken Links are links between local files that are broken. Using the UltraDev tools to move, rename, and edit files will usually keep this problem under control. If you edit the files by hand, however, you might find that you occasionally make a mistake or two.
External Links is a listing of the links that go outside your site. If you'd like to quickly generate a list of all the remote sites your HTML connects to, this is where you want to be. Although UltraDev doesn't check these remote links, it identifies them quickly, for verification in your Web browser. Figure 3.10 shows the results of a search for external links on a sample site.
The last form of link checking, Orphaned Files, is used to identify files that aren't connected to by any links inside the site. Unless external sites connect to these files, there is no way for a Web browser to reach them. They are considered orphaned from the rest of the site.
After running the link verification tests on your site, use the Save button to save a report to your drive. The report is a simple text file that can be used to keep track of what you've fixed or haven't. A sample report is included here:
Broken Links: test.html External Links: index.html http://www.zdnet.com/ links.html http://www.poisontooth.com/ links.html http://www.rebooty.com/ links.html http://www.shadesofinsanity.com/ othernewssites.htm http://www.cnn.com/ othernewssites.htm http://www.stepwise.com/ Orphaned Files: icbins.pl news.html index.html Files: 11 Total, 9 HTML, 3 Orphaned Links: 13 Total, 7 OK, 1 Broken, 6 External
The report contains all three link verification phases as well as a summary of the link status within the entire site.
Tip - If you'd like a quick way to check external links, you might want to try my linkcheck program, which is located at http://jray.ag.ohio-state.edu/. It allows you to check HTML on an existing site in real-time from within your Web browser.
Fixing a Broken Link
If you discover a link that is broken across your entire site, such as an external link that has changed or become obsolete, you can quickly make a global change to all the files in your site. Choose the Change Link Sitewide option from the Site menu.
In Figure 3.11, I've chosen to replace all links to the URL http://www.oldsite.com/ with http://www.newsite.com/. You can also use the folder icon to choose one of the files within your site, rather than typing them manually. Click the OK button, and your changes will quickly be made where necessary. UltraDev will even show you the files that are being updated as it searches them out.