META Http-Equiv for 301

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nige

    META Http-Equiv for 301

    I've got an old web site that comes up before its replacement in Google
    listings. I've read the document on Google about sending a "301" code
    from the server: http://www.google.co.uk/webmasters/3.html#A2

    Can anyone advise how to format a META Http-Equiv for a "301" code,
    including how to tell Google the new URL? I can't send it from the
    server, so I figure Http-Equiv is the next best.

    I still have access to the old site BTW.


    --
    Nige

    Please replace YYYY with the current year
    ille quis mortem cum maximus ludos, vincat
  • Anne van Kesteren

    #2
    Re: META Http-Equiv for 301

    Nige wrote:[color=blue]
    > I've got an old web site that comes up before its replacement in Google
    > listings. I've read the document on Google about sending a "301" code
    > from the server: http://www.google.co.uk/webmasters/3.html#A2
    >
    > Can anyone advise how to format a META Http-Equiv for a "301" code,
    > including how to tell Google the new URL? I can't send it from the
    > server, so I figure Http-Equiv is the next best.
    >
    > I still have access to the old site BTW.
    >
    >[/color]
    It is better to use .htaccess for this.

    Redirect permanent http://oldsite http://newsite

    --
    Anne van Kesteren
    <http://www.annevankest eren.nl/>

    Comment

    • Steve Pugh

      #3
      Re: META Http-Equiv for 301

      Nige <uYYYY@ntlworld .com> wrote:
      [color=blue]
      >I've got an old web site that comes up before its replacement in Google
      >listings. I've read the document on Google about sending a "301" code
      >from the server: http://www.google.co.uk/webmasters/3.html#A2
      >
      >Can anyone advise how to format a META Http-Equiv for a "301" code,
      >including how to tell Google the new URL?[/color]

      I don't think you can. The http-equiv attribute normally takes a http
      header as it's value. But 301 is a status code not a header.
      [color=blue]
      >I can't send it from the server, so I figure Http-Equiv is the next best.[/color]

      I doubt it. The whole point of a 301 is to redirect to the new
      location without downloading a file from the old location. Placing a
      pseudo-301 inside a file that needs to be downloaded is very much
      pointless.

      Google would probably quite fairly say that if it can download the
      file from the old URL then it will index the contents of that file
      under that URL.

      Will the old URL of your site being staying active indefintely or just
      for a short period?

      Steve

      --
      "My theories appal you, my heresies outrage you,
      I never answer letters and you don't like my tie." - The Doctor

      Steve Pugh <steve@pugh.net > <http://steve.pugh.net/>

      Comment

      • Alan J. Flavell

        #4
        Re: META Http-Equiv for 301

        On Fri, 21 Nov 2003, Nige wrote:
        [color=blue]
        > Can anyone advise how to format a META Http-Equiv for a "301" code,[/color]

        Who do you suppose is going to react to this META?

        It can't be the client: by the time that the client sees the meta, it
        has already been sent status 200 and the contents of the page: it's
        too late to change its mind, in the way that the HTTP protocol works.
        Even if there was a way to express this in META.)

        It _could_, in theory, be the server; but servers aren't usually set
        up to parse the HTML and act upon any META they might find. (There
        are good reasons for that: servers need a mechanism that works also
        with other kinds of content, like .gif, .jpg, .ps and so on - and once
        that general mechanism has been implemented, why bother with an extra
        one that only works for HTML content?)

        So the correct way to get a 301 status is by server configuration.
        Which, most often, as others have said, would be done by some kind of
        Redirect statement in the server configuration, .htaccess file etc.
        [color=blue]
        > I can't send it from the server,[/color]

        Are you sure? You might be right, but you wouldn't be the first
        person to have tried out .htaccess and found to their surprise (and in
        some cases to the surprise of their server admin ;-) that it worked.
        [color=blue]
        > I still have access to the old site BTW.[/color]

        That's obviously one pre-requisite ;-)

        good luck

        p.s meta...refresh is quite a different animal, but it's definitely
        the wrong answer to your requirement, for several reasons. You're
        absolutely right to want to do it with HTTP 301 status.

        Comment

        • Nige

          #5
          Re: META Http-Equiv for 301

          In comp.infosystem s.www.authoring.html, Anne van Kesteren wrote:
          [color=blue]
          >It is better to use .htaccess for this.
          >Redirect permanent http://oldsite http://newsite[/color]

          Could you explain further? How do I use this?


          --
          Nige

          Please replace YYYY with the current year
          ille quis mortem cum maximus ludos, vincat

          Comment

          • Peter Foti

            #6
            Re: META Http-Equiv for 301

            "Nige" <uYYYY@ntlworld .com> wrote in message
            news:9g5srvk3va 4adkoe1i8tisp9u 9oecb2a90@4ax.c om...[color=blue]
            > I've got an old web site that comes up before its replacement in Google
            > listings. I've read the document on Google about sending a "301" code
            > from the server: http://www.google.co.uk/webmasters/3.html#A2
            >
            > Can anyone advise how to format a META Http-Equiv for a "301" code,
            > including how to tell Google the new URL? I can't send it from the
            > server, so I figure Http-Equiv is the next best.
            >
            > I still have access to the old site BTW.[/color]

            If the page is ASP, you could do this:

            <%
            Response.Status = "301 Moved Permanently"
            Response.addhea der "Location", "http://www.newdomain.c om/newurl/"
            Response.End
            %>

            I've never used this myself, and it obviously doesn't work if your page is
            not an ASP page... but I thought I would post it just in case. :)
            Regards,
            Peter Foti


            Comment

            • Anne van Kesteren

              #7
              Re: META Http-Equiv for 301

              Nige wrote:
              [color=blue]
              > In comp.infosystem s.www.authoring.html, Anne van Kesteren wrote:
              >
              >[color=green]
              >>It is better to use .htaccess for this.
              >>Redirect permanent http://oldsite http://newsite[/color]
              >
              >
              > Could you explain further? How do I use this?
              >
              >[/color]

              1. Open notepad
              2. Paste that line into it. Since you have access to your old directory,
              you can paste it there and replace 'http://oldsite' with nothing.
              'http://newsite' should point towards your new site without a / at the end.
              3. Save the file as ".htaccess" (including " and ").
              4. Load it up into your old site's root dir or whatever dir your website
              used be in.
              5. Check if this works. If not, someone will probably correct my mistakes.

              --
              Anne van Kesteren
              <http://www.annevankest eren.nl/>

              Comment

              • D. Stussy

                #8
                Re: META Http-Equiv for 301

                On Fri, 21 Nov 2003, Peter Foti wrote:[color=blue]
                > "Nige" <uYYYY@ntlworld .com> wrote in message
                > news:9g5srvk3va 4adkoe1i8tisp9u 9oecb2a90@4ax.c om...[color=green]
                > > I've got an old web site that comes up before its replacement in Google
                > > listings. I've read the document on Google about sending a "301" code
                > > from the server: http://www.google.co.uk/webmasters/3.html#A2
                > >
                > > Can anyone advise how to format a META Http-Equiv for a "301" code,
                > > including how to tell Google the new URL? I can't send it from the
                > > server, so I figure Http-Equiv is the next best.
                > >
                > > I still have access to the old site BTW.[/color]
                >
                > If the page is ASP, you could do this:
                >
                > <%
                > Response.Status = "301 Moved Permanently"
                > Response.addhea der "Location", "http://www.newdomain.c om/newurl/"
                > Response.End
                > %>
                >
                > I've never used this myself, and it obviously doesn't work if your page is
                > not an ASP page... but I thought I would post it just in case. :)[/color]

                Similarly with PHP ( "header('Status : 301 xxx');" ), but I thought the idea was
                to keep all processing (file access) to a minimum. The ASP and PHP approaches
                would still require that a target file be read, while the .htaccess method
                doesn't cause that ADDITIONAL access (.htaccess is read anyway, unless one can
                put the redirection command directly into the main server configuration file -
                or one included from there).

                Comment

                • John F. Carr

                  #9
                  Re: META Http-Equiv for 301

                  In article <9g5srvk3va4adk oe1i8tisp9u9oec b2a90@4ax.com>,
                  Nige <uYYYY@ntlworld .com> wrote:[color=blue]
                  >I've got an old web site that comes up before its replacement in Google
                  >listings. I've read the document on Google about sending a "301" code
                  >from the server: http://www.google.co.uk/webmasters/3.html#A2
                  >
                  >Can anyone advise how to format a META Http-Equiv for a "301" code,
                  >including how to tell Google the new URL? I can't send it from the
                  >server, so I figure Http-Equiv is the next best.
                  >
                  >I still have access to the old site BTW.[/color]

                  If the sites are identical a <base href="..."> element in the head
                  section of the HTML will suggest a preferred URL. Files in my www
                  directory in the shared filesystem at MIT are accessible by at least
                  three URLs. Adding BASE caused Google to list my preferred URL.

                  (This isn't the primarily or originally intended use of base but it
                  works.)

                  --
                  John Carr (jfc@mit.edu)

                  Comment

                  Working...