473,396 Members | 1,683 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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
Jul 20 '05 #1
8 5163
Nige wrote:
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.

It is better to use .htaccess for this.

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

--
Anne van Kesteren
<http://www.annevankesteren.nl/>
Jul 20 '05 #2
Nige <uY***@ntlworld.com> wrote:
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 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.
I can't send it from the server, so I figure Http-Equiv is the next best.


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 <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #3
On Fri, 21 Nov 2003, Nige wrote:
Can anyone advise how to format a META Http-Equiv for a "301" code,
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.
I can't send it from the server,
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.
I still have access to the old site BTW.


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.
Jul 20 '05 #4
In comp.infosystems.www.authoring.html, Anne van Kesteren wrote:
It is better to use .htaccess for this.
Redirect permanent http://oldsite http://newsite


Could you explain further? How do I use this?
--
Nige

Please replace YYYY with the current year
ille quis mortem cum maximus ludos, vincat
Jul 20 '05 #5
"Nige" <uY***@ntlworld.com> wrote in message
news:9g********************************@4ax.com...
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.


If the page is ASP, you could do this:

<%
Response.Status = "301 Moved Permanently"
Response.addheader "Location", "http://www.newdomain.com/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
Jul 20 '05 #6
Nige wrote:
In comp.infosystems.www.authoring.html, Anne van Kesteren wrote:

It is better to use .htaccess for this.
Redirect permanent http://oldsite http://newsite

Could you explain further? How do I use this?


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.annevankesteren.nl/>
Jul 20 '05 #7
On Fri, 21 Nov 2003, Peter Foti wrote:
"Nige" <uY***@ntlworld.com> wrote in message
news:9g********************************@4ax.com...
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.


If the page is ASP, you could do this:

<%
Response.Status = "301 Moved Permanently"
Response.addheader "Location", "http://www.newdomain.com/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. :)


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).
Jul 20 '05 #8
In article <9g********************************@4ax.com>,
Nige <uY***@ntlworld.com> wrote:
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.


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 (jf*@mit.edu)
Jul 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Christian Hvid | last post by:
Hello groups. I have a series of applet computer games on my homepage: http://vredungmand.dk/games/erik-spillet/index.html http://vredungmand.dk/games/nohats/index.html...
24
by: Day Bird Loft | last post by:
Web Authoring | Meta-Tags The first thing to understand in regard to Meta Tags is the three most important tags placed in the head of your html documents. They are the title, description, and...
4
by: clintonG | last post by:
Anybody know how to dynamically write the meta tags using code so they are formatted on a separate line in the HTML source? Preferred or optimal framework classes that may be used in this regard? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.