http 301的语法 [英] syntax for http 301

查看:135
本文介绍了http 301的语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试更新旧网站的页面,以便他们使用

http 301重定向到新网站,而不是http-equiv =

刷新 (哪些搜索引擎不遵循,因此卡在

旧网站上)

这是当前将客户端重定向到新网站的代码(它是

对于旧网站上的每个页面都是一样的,只是为特定目的地调整了一点

),有人可以告诉我如何轻松修改
它像我想的那样?我不太熟悉

语法,提前谢谢。


< HTML>

< HEAD> ;

< META HTTP-EQUIV =" refresh" content =" 0; URL = http://www.newsite.com

">

< TITLE>页面已移动< / TITLE>

< / HEAD>

< BODY>

如果您的浏览器未自动重定向您,请点击< A

HREF =" http://www.newsite.com

"> here< / A>转到新页面。

< / BODY>

< / HTML>

i''m trying to update the pages of an old website so that they use
http 301 to redirect to the new website, instead of http-equiv=
"refresh" (which search engines do not follow and thus get stuck at the
old site)
Here is the code currently redirecting clients to the new site (it''s
the same for every page on the old site, just tweaked a little
obviously for specific destinations), could someone show me how to
easily modify it as I would like? I''m not very familiar with the
syntax, thanks in advance.

<HTML>
<HEAD>
<META HTTP-EQUIV="refresh" content="0;URL=http://www.newsite.com
">
<TITLE>Page has moved</TITLE>
</HEAD>
<BODY>
If your browser does not automatically redirect you, click <A
HREF="http://www.newsite.com
">here</A> to go to the new page.
</BODY>
</HTML>

推荐答案

ni*****@wtexec.com 写道:
ni*****@wtexec.com wrote:
我正在尝试更新旧网站的页面,以便他们使用
http 301重定向到新网站,而不是http-equiv =
刷新 ; (哪些搜索引擎不遵循,因此卡在旧网站上)
i''m trying to update the pages of an old website so that they use
http 301 to redirect to the new website, instead of http-equiv=
"refresh" (which search engines do not follow and thus get stuck at the
old site)




这是一个HTTP问题,而不是HTML问题。你怎么做取决于你的
服务器。

-

David Dorward< http://blog.dorward.me.uk /> < http://dorward.me.uk/>

Home是〜/ .bashrc的地方



That''s an HTTP issue, not an HTML issue. How you do it depends on your
server.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


2005年7月19日13:51:09 -0700, ni*****@wtexec.com 写道:
On 19 Jul 2005 13:51:09 -0700, ni*****@wtexec.com wrote:
我正在尝试更新旧网站的页面,以便他们使用
http 301重定向到新网站,而不是http-equiv =
刷新 ; (哪些搜索引擎不关注,因此卡在旧网站上)
i''m trying to update the pages of an old website so that they use
http 301 to redirect to the new website, instead of http-equiv=
"refresh" (which search engines do not follow and thus get stuck at the
old site)




[HTML code snipped]


您需要在服务器中进行重定向,而不是在HTML中。 (当你观察到
时,搜索引擎不会接受HTTP刷新。)


重定向命令的具体性质取决于什么服务器

你正在运行。例如,在Apache服务器上,您可以将一个

RedirectPermanent行放入根网站

目录中的.htaccess文件中。


http://httpd.apache.org/docs/mod/mod_alias.html#redirectperm

-

Stan Brown,Oak Road Systems,Tompkins美国纽约郡

http://OakRoadSystems.com/

HTML 4.01规范:http://www.w3.org/TR/html401/

验证器:http://validator.w3.org/

CSS 2.1规范:http://www.w3.org/TR/CSS21/

验证者:http://jigsaw.w3.org/css-validator/

为什么我们不能帮助你:

http://diveintomark.org / archives / 2003/05/05 / why_we_wont_help_you



[HTML code snipped]

You need to do the redirect in your server, not in HTML. (As you
observed, search engines won''t pick up on an HTTP-refresh.)

The specific nature of the redirect command depends on what server
you''re running. For instance, on an Apache server you would put a
RedirectPermanent line into your .htaccess file in root Web
directory.

http://httpd.apache.org/docs/mod/mod_alias.html#redirectperm

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won''t Help You:
http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you


JRS:文章< 11 ****************** ****@o13g2000cwo.googlegroups .com>

,日期为2005年7月19日星期二13:51:09,见于新闻:comp.infosystems。 www.aut

horing.html, ni ***** @ wtexec.com 发布:
JRS: In article <11**********************@o13g2000cwo.googlegroups .com>
, dated Tue, 19 Jul 2005 13:51:09, seen in news:comp.infosystems.www.aut
horing.html, ni*****@wtexec.com posted :
我正在尝试更新旧页面网站,以便他们使用
http 301重定向到新网站,而不是http-equiv =
刷新 (哪些搜索引擎不遵循,因此卡在旧网站上)
i''m trying to update the pages of an old website so that they use
http 301 to redirect to the new website, instead of http-equiv=
"refresh" (which search engines do not follow and thus get stuck at the
old site)



这真的很重要,只要有一个页面的路线

搜索引擎只知道使用标准的每个其他页面

< a href =" ..."> ...< / a>链接,可以将一个主页

页面连接到所有其他页面或将这些页面连接成一个环?


(这表示不反对使用301其他原因。)


-

?约翰斯托克顿,英国萨里。 ?@merlyn.demon.co.uk Turnpike v4.00 IE 4?

< URL:http://www.jibbering.com/faq/> JL / RC:新闻常见问题:comp.lang.javascript

< URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr数学,日期,来源。

< URL:http://www.merlyn.demon.co.uk/> TP / BP / Delphi / jscr /& c,常见问题项目,链接。


Does that really matter, so long as there is a route from one page that
the search engines will know of to every other page using only standard
<a href="...">...</a> links, for which one can either connect one prime
page to all others or connect the pages in a ring?

(That says nothing against using 301 for other reasons.)

--
? John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ?
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.


这篇关于http 301的语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆