V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
forreal
V2EX  ›  Django

问一个关于 Django 文档的一个小白问题

  •  
  •   forreal · 2014-06-27 10:43:26 +08:00 · 3130 次点击
    这是一个创建于 3593 天前的主题,其中的信息可能已经有所发展或是发生改变。
    文档是这样写的
    Because the URL patterns are regular expressions, there really is no limit on what you can do with them. And there’s no need to add URL cruft such as .html – unless you want to, in which case you can do something like this:

    (r'^polls/latest\.html$', 'polls.views.index'),
    But, don’t do that. It’s silly

    以.html结尾不是伪静态吗?为什么说是silly?
    5 条回复    2014-06-27 19:32:32 +08:00
    maguowei
        1
    maguowei  
       2014-06-27 11:21:47 +08:00   ❤️ 1
    对于现代的浏览器这样的伪静态对于seo应该没有多大影响了吧
    maguowei
        2
    maguowei  
       2014-06-27 11:22:28 +08:00
    @maguowei 浏览器->搜索引擎
    wesley
        3
    wesley  
       2014-06-27 11:24:25 +08:00   ❤️ 1
    你需要伪静态就加.html
    文档的意思可能是会混淆动静态文件
    multiple1902
        4
    multiple1902  
       2014-06-27 11:40:49 +08:00   ❤️ 1
    因为 .html 写在 URL 里面没有什么实际意义呀。一个网址是不是网页是 MIME Type 决定的,而不是后缀(扩展名)。后缀可能在本地文件系统里面有助于操作系统的文件关联,但在 URL 里看不出实际意义。

    就像微博上一群人昵称写成「@XX 微博」,好像不写最后两个字别人就不知道这是微博似的,确实 silly。

    当然人家这个 silly 也许是因为 @XX 已经被别人注册了,你写网站的恐怕没这个担心。
    forreal
        5
    forreal  
    OP
       2014-06-27 19:32:32 +08:00
    @maguowei
    @wesley
    @multiple1902

    明白了一些。多谢
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3434 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 10:49 · PVG 18:49 · LAX 03:49 · JFK 06:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.