如果JavaScript已关闭,则重定向 [英] Redirecting if JavaScript is turned off

查看:71
本文介绍了如果JavaScript已关闭,则重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用大量Javascript的网站。


如果有人查看网站但没有启用Javascript我想要礼貌地支付
将它们重定向到另一个页面,所以我把这段代码放在我的

< head>部分:


< script type =" text / javascript"

language =" JavaScript"> document.write("< ;! " +" - ")< / script>

< meta http-equiv =" Refresh"含量=" 0; URL = noscript.html">

<! - // - >


到目前为止一切顺利。

它似乎工作,*和*它通过''W3C MarkUp验证服务''

测试( http://validator.w3.org/


现在坏消息:Google没有为我的网站编制索引更多,大概是因为他们的爬行器总是被重定向。


有没有人有这个困境的解决方案,请?

重定向到''with-script''页面不是一个选项,因为我的页面被许多其他网站链接到了


I have a modest website that uses a lot of Javascript.

If anybody views the site and does not have Javascript enabled I want to
politely redirect them to another page, so I put this bit of code in my
<head> section :

<script type="text/javascript"
language="JavaScript">document.write("<!"+"--")</script>
<meta http-equiv="Refresh" content="0; URL=noscript.html">
<!--//-->

So far so good.
It appears to work, *and* it passes the the ''W3C MarkUp Validation Service''
test ( http://validator.w3.org/ ).

Now the bad news: Google doesn''t index my site any more, presumably because
their crawler always gets redirected.

Does anybody have a solution to this dilema, please?
Redirecting to a ''with-script'' page is not an option because my page is
linked-to by many other sites.

推荐答案

Peter于2004年2月28日在comp.lang.javascript中写道
Peter wrote on 28 feb 2004 in comp.lang.javascript:
如果有人查看该网站并且没有启用Javascript我希望
礼貌地将它们重定向到另一个页面,所以我把这段代码
放在我的< head>中部分:

< script type =" text / javascript"
language =" JavaScript"> document.write("<!" +" - " ;)< / script>
< meta http-equiv ="刷新"含量=" 0; URL = noscript.html">
<! - // - >


尝试相反:

从无javascript文件和clientside-js-redirect开始

到yes javascript页面。

现在坏消息:谷歌没有索引我的网站,大概是
因为他们的爬虫总是被重定向。
If anybody views the site and does not have Javascript enabled I want
to politely redirect them to another page, so I put this bit of code
in my <head> section :

<script type="text/javascript"
language="JavaScript">document.write("<!"+"--")</script>
<meta http-equiv="Refresh" content="0; URL=noscript.html">
<!--//-->

Try doing it the other way around:

Start with the no javascript file and clientside-js-redirect
to the yes javascript page.
Now the bad news: Google doesn''t index my site any more, presumably
because their crawler always gets redirected.




最好在服务器端完成:


如果IP在谷歌范围内,重定向

-

Evertjan。

荷兰。

(请将x''es更改为我的电子邮件地址中的点数)



This can best be done serverside:

if the IP is in the google range, redirect
--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)




Evertjan。 <前************** @ interxnl.net>在消息中写道

news:Xn ******************** @ 194.109.133.29 ...

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Peter写于2004年2月28日的comp.lang.javascript
Peter wrote on 28 feb 2004 in comp.lang.javascript:
现在坏消息:Google不再为我的网站编制索引,大概是
因为他们的抓取工具总是被重定向。
Now the bad news: Google doesn''t index my site any more, presumably
because their crawler always gets redirected.



这最好在服务器端完成:

如果IP在google范围内,重定向



This can best be done serverside:

if the IP is in the google range, redirect




当谷歌发现你正在伪装时,该网站将被禁止。

http://www.google.com.au/webmasters/2.html#A1 - 页面底部。


干杯

Richard。



And when google find out that you are cloaking the site will be banned.

http://www.google.com.au/webmasters/2.html#A1 - bottom of the page.

Cheers
Richard.


Richard Formby于2004年2月29日在comp.lang上写道。 javascript
Richard Formby wrote on 29 feb 2004 in comp.lang.javascript:

Evertjan。 <前************** @ interxnl.net>在消息中写道
新闻:Xn ******************** @ 194.109.133.29 ...

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Peter写于28日2004年在comp.lang.javascript
Peter wrote on 28 feb 2004 in comp.lang.javascript:
>现在是坏消息:Google不再为我的网站编制索引,大概是
>因为他们的爬虫总是被重定向。
> Now the bad news: Google doesn''t index my site any more, presumably
> because their crawler always gets redirected.



这最好在服务器端完成:

如果IP在google范围内,重定向



This can best be done serverside:

if the IP is in the google range, redirect


http://www.google.com.au/webmasters/2.html#A1 - 页面底部。




或许下来了?


无论如何上面的网站都没有用Google搜索,所以如果OP想要它,他必须

发明了一些东西,以保持谷歌在大多数

访客看到的页面上。

-

Evertjan。

荷兰。

(请在我的电子邮件地址中将x'变为点数)



Perhaps down under?

The above site wasn''t googled anyway, so if the OP wants it, he has to
invent something to keep google on the page that the majority of the
visitors see.
--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


这篇关于如果JavaScript已关闭,则重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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