95.13 Redirect Web Pages

20220402

If a web page has moved, the adding a refresh to the header of the html will redirect to the new location. For example some html page has moved to https://my.new.com/perls.html so add the following meta directive in the appropriate place (just after the head) and perhaps also add a message a link in case the redirect fails.

<html>
  <head>
    <meta http-equiv="Refresh" content="0; url='https://my.new.com/perls.html'" />
    ...
  </head>
  <body>
     <p>This page has moved to <a href="https://my.new.com/perls.html">My New Site</a>.</p>
    ...
  </body>
</html>

If this needs to be done for many files then see Section 18.16 for a command line to insert a line of text after the <head>.



Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0