Making Sure Your Hyperlinks Work


If you spend any time surfing the Web, you probably click a broken link now and then. Whereas the occasional broken link is merely an annoyance, several can damage your site's reputation and send your visitors stalking away in a huff.

A hyperlink breaks if the destination page the link points to becomes unreachable. A link can break because the Web server on which the destination page is stored goes down or because the page's author moves or renames the page. After a visitor clicks a broken hyperlink, rather than deliver the requested page, the destination Web server delivers an error message stating that it can't find the page.

The most common cause of broken hyperlinks-renaming a page in your Web site and then forgetting to update the hyperlinks elsewhere in the Web site that lead to the page-is a moot point in Expression Web. The program automatically updates hyperlinks for you as long as you do all your moving, shuffling, and renaming inside Expression Web. (We describe all the details of maintaining files in Chapter 13.)

Certain situations are beyond Expression Web's control, however, and cause hyperlinks in your Web site to break:

  • You delete a file that another page in the Web site is linked to.

  • You import an existing Web site into Expression Web and leave out some files.

  • You mistype a URL while creating a hyperlink to a site on the Internet.

  • You create a link to a site on the Internet, and that site changes location or otherwise becomes unreachable.

Fortunately, Expression Web knows how to deal with these pitfalls and can perform the following tricks:

  • Find all broken or unchecked links in your Web site and list them in the Hyperlinks report

  • Check links to external Internet sites to make sure they work properly

  • Enable you to fix individual broken links

  • Update the corrected links in selected pages or throughout the entire Web site

Verifying hyperlinks

Verifying hyperlinks involves locating broken internal links (links between pages and files that reside inside the Web site) and double-checking external links to make sure they work.

To verify the hyperlinks in your Web site, follow these steps:

  1. Activate your Internet connection.

  2. Save all open pages, if you haven't already, by choosing File image from book Save All.

  3. Choose Site image from book Reports-->Problems image from book Hyperlinks.

    Expression Web switches from Design view to the Hyperlinks report in Reports view. The report displays a list of broken internal hyperlinks and as-yet-unverified external hyperlinks, as shown in Figure 4-3. Broken internal links (if any exist) are flagged with the status label Broken and a broken chain-link icon, and unverified external links are flagged with the label Unknown and a question mark icon.

    image from book
    Figure 4-3: The Hyperlinks report.

    Expression Web may also display a message asking whether you want it to verify the hyperlinks in your Web site.

  4. image from book In the upper-right corner of the Hyperlinks report, click the Verifies Hyperlinks in Current Web button. Or, if the Verify Hyperlinks message appears, select Yes.

    The Verify Hyperlinks dialog box appears.

    If the report turned up unknown hyperlinks, you have the choice of verifying all hyperlinks or only those that are unknown.

  5. In the dialog box, click the Start button.

    If your Web site contains lots of external links, the verification process takes awhile. Be sure that you have a few minutes to spare.

    After you click the Start button, Expression Web verifies each external link by contacting the destination Web server and then making sure that it can reach the page. As the verification process is going on, a progress message appears on the Expression Web status bar to let you know what's happening. As Expression Web checks each link, its status label in the report changes from a question mark to either a green check mark followed by OK (indicating valid links) or a broken chain link followed by Broken (indicating broken links). When the verification process is complete, Expression Web lists a summary of its findings on the status bar.

To stop the verification process, press the Esc key. To resume verifying hyperlinks, click the Verifies Hyperlinks in the Current Web button again.

Fixing broken hyperlinks

If Expression Web finds any broken links, you need to fix them. To do so, follow these steps:

  1. If you haven't already, follow the steps in the preceding section.

  2. From the Hyperlinks report, double-click the broken hyperlink you want to fix.

    The Edit Hyperlink dialog box appears, as shown in Figure 4-4.

    image from book
    Figure 4-4: The Edit Hyperlink dialog box shows a broken hyperlink.

  3. Decide whether you want to edit the page containing the hyperlink or update the hyperlink destination itself; then take the appropriate action:

    To edit the page containing the link, click the Edit Page button. The page opens in Design view so that you can fix the ailing link. When you switch back to Reports view, repaired internal links disappear from the list, and the status of repaired external links changes from Broken to OK if they work (if Expression Web can test them via your Internet connection and they check out okay) or to Unknown, if they still don't work.

    To edit the link itself, in the Edit Hyperlink dialog box, type a new URL in the Replace Hyperlink With text box. If you can't recall the URL, click the Browse button to launch your Web browser. Browse to the destination, and when you switch back to Expression Web, the destination URL should be visible in the text box. (If it isn't, copy the URL from the browser and paste it into the Replace Hyperlink With text box.) To change the link in selected pages (rather than throughout the entire Web site), select the Change in Selected Pages option button and then click the names of the pages you want to update in the box underneath it. Click the Replace button to fix the hyperlink and close the dialog box.

  4. Continue repairing broken hyperlinks by repeating Steps 2 and 3, and then click the Verifies Hyperlinks in Current Web button again to recheck.

    Like a carpenter who measures twice before cutting, rechecking your links ensures that all your links work as advertised!

To exit from Reports view, in the editing window, click a Web page tab or click Folders in the lower-left corner of the Web Site tab.

Tip 

After you publish your finished site, we recommend verifying your site's hyperlinks at least every couple of weeks. Web pages move and change all the time, breaking hyperlinks in your Web site. Expression Web makes checking your links easy-why not make it a regular habit?



Microsoft Expression Web for Dummies
Microsoft Expression Web For Dummies
ISBN: 0470115092
EAN: 2147483647
Year: 2004
Pages: 142

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net