WordPress实现页面跳转和链接跳转的方法

方法一:页面跳转

以前一直在找wordpress页面跳转的方法,有调用模版然后实现跳转的,试了一下貌似对小z博客的主题不起作用,最后还是以失败告终。但是现在问题终于解决了,只是用了javascript的一句代码,不仅简单还达到了目的,分享一下了。

新建一个页面,在文本模式下将下面的代码粘贴到内容栏中即可实现页面跳转了将其

中的链接地址改为你自己想要跳转的域名。

<script language="javascript">
document.location= "http://blog.0660hf.com/";
</script>

需要注意的是页面的固定链接建议自己设置一下,不要使用中文,否则会被转义增加长度,对SEO不利。

WordPress实现页面跳转和链接跳转的方法

方法二:外链跳转

我们在写文章的时候可能难免会遇到需要跳转到外链的时候,但是直接跳转到外链可能会被搜索引擎降权,怎么办呢?那么这里提供两种非常简单的外链跳转方法来解决此问题。

1、打开Editplus新建一个PHP文件,复制粘贴如下代码,然后另存为go.php再上传到网站根目录。

<?php header("location:".$_GET["url"]); ?>

然后跳转的格式为:{本站地址}/go.php?url={外链地址},列:

http://blog.0660hf.com/go.php?url=http://weibo.com/yiguochun

2、打开Editplus新建一个PHP文件,复制粘贴如下代码,然后另存为go.php再上传到网站根目录。

<?php header("location:".$_SERVER['QUERY_STRING']); ?>

这样出来的形式就是{本站地址}/go.php?{外链地址},相对于第一种来说去掉了url=,然后稍微简短了一些。

小z提示:最后不要忘记在robots.txt文件中添加:Disallow: /go.php?,防止搜索引擎抓取go.php,不然起不到任何作用。

yiguochun

yiguochun(http://blog.0660hf.com/)0660SEO博客是以seo网站优化,Seo学习,sEO知识,SEO网络推广技巧及站长分享经历的媒体博客,为SEO爱好者和广大站长提供一个SEO案例分享和交流的平台,从分享SEO分享交流过程中带来更多的心满意足。

You may also like...

20 Responses

  1. Thanks to my father who shared with me about this
    website, this webpage is in fact amazing.

  2. mp4porn.xyz说道:

    Interracial BBC Gangbang Teen. Asian fucked in the box as she sucks dick.

    most gay. Group of gals receive nailed. More corruption with fifa boss.

  3. I’m reаlly enjoying tһe design and layout of yߋur blog.
    It’s a very easy on thе eyes which makes it much more enjoyable for me tо come here and visit mߋrе օften. Ɗiⅾ you hire
    out a designer tⲟ creɑte yoսr theme? Excellent ԝork!

  4. If you are going foг finest contеnts like mysеlf, only pay a quick
    visit thiѕ site all the tіme bеcɑuѕe it рresents quality contents,
    tһanks

  5. Zorinapag说道:

    took online

    e4fd nz cheapest online online

  6. Veselinapag说道:

    is wirkung forum

    3a33 is pfizer online

  7. Sadofpag说道:

    venta de is india

    3292 when to take is forum

  8. Domnikapag说道:

    is ato brasil

    553b can you get is in greece

  9. Domnikapag说道:

    only now brand is for sale

    553b is montpellier

  10. Vasilkopag说道:

    is tablets 20mg in sydney

    03b0 we choice is prices

  11. Rannevpag说道:

    waar kan ik viagra bestellen

  12. Rannevpag说道:

    viagra 50mg tablet price

  13. Leilapag说道:

    where can you be is drugs

    bfcf best is pill cutter

  14. Leilapag说道:

    online at cheap is

    bfcf take is best effect

  15. Leilapag说道:

    i use it is online online

    bfcf is does nothing for me

  16. Ingeborgpag说道:

    is billig piller

    1e9d is vent

  17. Danapag说道:

    forum is pharmacie

    bf25 be is soft europe

  18. Danapag说道:

    ata is 50mg

    bf25 only now is online doctor

  19. Severinpag说道:

    is 42 an

    f5a0 differenza is o levitr

  20. Severinpag说道:

    is hives

    f5a0 be is for female

发表评论