move link

Posted on 2005-05-06
Last Modified: 2008-03-06
I have my own web that many page link to it , If I move that page to another directory how can I set the other pages  link to new directory,
Question by:teera
    LVL 3

    Accepted Solution

    If I understood correctly you want to redirect people from one web page to another, because you moved the page somewhere else.
    One way to do this is using a redirect meta tag:

    <meta http-equiv="refresh" content="2;url=http://destination/path">

    You should put this tag on the header section of the html page
    In this case 2 is the number of seconds that the page will be shown before the redirection. This allows you to show the viewers that the content was moved before redirecting them automatically.

    LVL 11

    Assisted Solution

    I would suggest avoiding this META tag whenever possible.
    Many browsers nowadays has security settings that does not allow redirection via META.
    Also, you cannot put it in your current index file, because it would then refresh itself over and over again.
    It is better to use server-side scriptning instead. Then you will be sure your visitors will be redirected.

    The 301 status code is used to indicate that a page has permanently moved.
    In order to redirect an out-of-print web page to another location, return the HTTP 301 status code and a location header in the HTTP response of the deprecated web page. This is also particularly useful for search engines like Google, which will carry over page rank to the new page if this status code is seen. See code below:
    If you are using ASP:
    <%@ Language=VBScript %>
    ' Permanent redirection
    Response.Status = "301 Moved Permanently"
    Response.AddHeader "Location", ""
    If you are using PHP:
    // Permanent redirection
    header("HTTP/1.1 301 Moved Permanently");
    If you don't have server-side scripting support on your web server, you can still do redirection, but not as elegantly.
    My suggestion is to create a new html page using below code, place it in the old directory. Note that some users may have javascript disabled, hence the need to create a link inside the body of the document.
    <script type="text/javascript">
    This page has moved to <a href=""></a>

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
    This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
    The viewer will learn how to count occurrences of each item in an array.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now