Computer Reference: HTML



  • Category
    HTML
  • Title
    Redirect to another page
  • Description

    It is sometimes necessary for a URL to open a page which does nothing more than simply redirect to another web page.  For example, I recently had a system go belly up, and had to get a working site in a hurry without destroying the existing file structure of the site, and, at the same time making the change transparent to users accessing the original site's URL.

    To give me time to salvage critical portions, I simply created a sub-site, ie:

    • Assuming the original URL was, say, http://homepage.mysite.com, I created a subsite which would be accessible at http://homepage.mysite.com/restored
    • I then restored a recent backup of the original site to the new sub-site.
    • Now, to make the change transparent, I needed to have all access to the original site redirected to the sub-site.

    Here's the HTML for a file which does the job:

      meta http-equiv="refresh" content="delay_time; URL=new_website_url" />

    Keep in mind that you may have to perform similar redirections for extant sub-sites of the original.