【问题标题】:Customs URL / Deeplinking海关 URL / 深层链接
【发布时间】:2012-02-16 18:21:33
【问题描述】:

我有一个问题。

我有一个常规网站,当用户访问该网站时,我希望自定义 url 指向这些页面。

index.html -       custom_index.cfm?custom_id=1&page_id=1&inc=index

关于.html -       custom_index.cfm?custom_id=5&page_id=5&inc=about

contactus.html -       custom_contactus.cfm?custom_id=3&page_id=3&inc=contactus

我该如何处理?

这样的东西会起作用吗?

  if (window.location.search.match(/(\?|&)custom_index.cfm?custom_id=3&page_id=3&inc=contactus($|&)/)) {
Load page
}

【问题讨论】:

  • 等等,等等,冷聚变?也许你无法控制不得不使用它......但你可能想看看这篇文章:aralbalkan.com/1864

标签: javascript jquery html deep-linking


【解决方案1】:

Apache mod_rewrite 应该在这里为您提供帮助 - 查看 this article 应该可以帮助您。

祝你好运!

【讨论】:

  • 有什么意义?当网站访问者返回 blah.com/about.html 并且该页面不存在因此出现 404 错误时会发生什么?您将需要使用 mod_rewrite 将所有 404 错误重定向到特定页面以处理此问题,因为您最好只编写一次代码而不是三次 - 一次用于 JS 中的 URL 重写处理程序,一次用于 404 处理程序进行翻译和最后是你的 mod_rewrite 404 处理程序
  • 经过 20 秒的搜索,我找到了 this,它应该可以为您提供所需的答案
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-12-15
相关资源
最近更新 更多