Skip to main content
Engineering LibreTexts

8.4: Redirecting Pages

  • Page ID
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    You probably have visited Web sites at which you are automatically redirected from one page to another. This technique is often used when a home page is moved from one URL to another. For a certain period of time, the original URL redirects to the new URL until users have a chance to change their bookmarks or link references.

    The <meta> Tag

    Redirection is provided with a <meta> tag which appears in the <head> section of the document, and in general, is used to provide information about the HTML document. A general format for this redirection type tag is shown below.

          content="seconds; url=url"

    Listing 7-17. General format for <meta> tag.

    The http-equiv attribute identifies this use of the <meta> tag as a refreshing, or reloading, of the current page. The content attribute specifies the number of seconds to wait before reloading takes place, along with the URL of the page to which redirection is to take place when the current page is reloaded.

    For example, the following link goes to a page named Redirect.htm located in the current directory. The Redirect.htm page is coded with a meta tag that redirects back to this page after five seconds.

    Redirect Page

    In the <head> section of the Redirect.htm page is the following <meta> tag to link back to this page.

          <title>Redirect Page</title>
          <meta http-equiv="refresh" content="5; url=redirecting-pages.aspx">

    Listing 7-18. Coding to automatically redirect to a different page.

    A Slide Show - TOP

    <meta> tag with http-equiv and content attributes can also be coded on a series of pages to provide a self-running slide show that automatically loads one page after another. Each <meta> tag specifies the viewing time for the page along with a link to the next page in sequence.

    The following graphic link loads the first (Slide1.htm) of five pages of a slide show that are all located in the current directory. This initial link is coded below.

        <a href="Slide1.htm"><img src="Pixar.gif" alt="View Slide Show"></a>
    Link to pixar slide show.

    Figure 7-15. Link to slide show.

    Each of the slide show pages contains a <meta> tag giving the URL of the next page in sequence and setting the refresh timer for three seconds. The following abbreviated code appears on the slide pages.

          <title>Slide 1</title>
          <meta http-equiv="refresh" content="3; url=Slide2.htm">
          <h1>Toy Story</h1>
          <p><img src="ToyStory.jpg" alt="Toy Store Image"></p>
          <title>Slide 2</title>
          <meta http-equiv="refresh" content="3; url=Slide3.htm">
          <h1>A Bug's Life</h1>
          <p><img src="BugsLife.jpg" alt="A Bugs's Life Image"></p>
          <title>Slide 3</title>
          <meta http-equiv="refresh" content="3; url=Slide4.htm">
          <h1>Finding Nemo</h1>
          <p><img src="FindingNemo.jpg" alt="Finding Nemo Image"></p>
          <title>Slide 4</title>
          <meta http-equiv="refresh" content="3; url=Slide5.htm">
          <h1>Monsters, Inc.</h1>
          <p><img src="MonstersInc.jpg" alt="Monsters, Inc. Image"></p>
          <title>Slide 5</title>	
          <meta http-equiv="refresh" content="3; url=xhtml07-04.htm">
          <h1>Toy Story 2</h1>
          <p><img src="ToyStory2.jpg" alt="Toy Store 2 Image"></p>

    Listing 7-19. Partial coding for slide show pages.

    The final page of the slide show redirects back to this tutorial page containing the original link to the first slide.

    If you want to run the show in a separate browser window, then the original link opens a new window.

        <a href="Slide1.htm" target="_blank">
          <img src="Pixar.gif" alt="View Slide Show">

    Listing 7-20. Opening a slide show in a separate browser window.

    Note that since a <meta> tag cannot close a browser window, the final slide page that is opened in this separate window should not contain a <meta> tag to redirect back to the original page, thereby resulting in the original page being opened in two separate windows: in the original window and in the separate slide-show window. Rather, the final page of the slide show should inform visitors simply to close the slide show window to reveal the original window containing the original link page.


    8.4: Redirecting Pages is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?