【问题标题】:How do i redirect specific tumblr pages?如何重定向特定的 tumblr 页面?
【发布时间】:2011-06-09 04:30:39
【问题描述】:

我想在每次访问页面时将“http://iancalimbahin.tumblr.com”重定向到“http://iancalimbahin.tumblr.com/home”。 但是当我打开其他页面如“/tagged/DigitalArts”、“/tagged/photos”和其他“/tagged”页面时,页面仍然重定向到“/home”。 如何排除某些页面(/标记)被重定向?

【问题讨论】:

  • 您可能想澄清您已经尝试重定向页面的内容,并解释您为什么要这样做。 Tumblr 无法让你对其页面进行太多控制,因此解决方案可能会涉及 Javascript。
  • 我想为我的 tumblr 帐户创建一个静态登录页面,这样当访问 iancalimbahin.tumblr.com 时,查看者将被自动重定向到登录页面。登陆页面包含指向我不同标记帖子的链接,例如“/photos”、“/digitalarts”等。
  • 任何方法都可以,只要tumblr可以执行代码。
  • Arvin,帮助 naman 哦。萨拉马特。

标签: html redirect tumblr


【解决方案1】:

自定义您的 tumblelog 并尝试添加此脚本:

<script type="text/javascript">
if(location.href == 'http://iancalimbahin.tumblr.com/') location.replace('http://iancalimbahin.tumblr.com/home');;
</script>

当您在 Theme 下选择 Custom HTML 时,将其放在 &lt;head&gt; 标记之后。

【讨论】:

  • 回答已接受!非常感谢。您可以在iancalimbahin.tumblr.com 查看我的网站,以查看我在主页上所做的工作。谢谢! :)
【解决方案2】:

使用 location.replace(url) 是个好主意,但您还应该在 head 部分添加一个 rel="canonical" 标记,以通知您更喜欢显示 /home 的搜索引擎搜索引擎结果页面中的纯子域。

使用这个javascript redirection generator 工具,您可以创建完全兼容的重定向脚本。这还包含一个在 IE 下传递 http 引荐来源网址的技巧。您还应该在 noscript 元素中添加一个 html 重定向元标记来重定向禁用 javascript 的浏览器!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-21
    • 2012-08-16
    • 1970-01-01
    相关资源
    最近更新 更多