【问题标题】:How do I use #! instead of just # in Durandal URLs?我该如何使用#!而不仅仅是在 Durandal URL 中的 #?
【发布时间】:2013-03-16 21:42:21
【问题描述】:

默认情况下,使用 Durandal 路由器创建的 URL 格式如下:

http://example.com/#/whiskey-tango-foxtrot

但是,我想使用 #!出于 SEO 目的,因此 URL 如下所示:

http://example.com/#!/whiskey-tango-foxtrot

有关我的意思的更多信息,请参阅:https://developers.google.com/webmasters/ajax-crawling/

知道我可以如何使用 Durandal 完成此任务吗?

【问题讨论】:

标签: url durandal fragment-identifier hashbang


【解决方案1】:

您可能必须覆盖路由器插件,例如“preparerouteInfo”功能和其他功能(cancelNavigation)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-08-20
    • 1970-01-01
    • 2012-05-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-14
    • 1970-01-01
    相关资源
    最近更新 更多