forreal
V2EX  ›  Django

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

  •  
  •   forreal · Jun 27, 2014 · 3875 views
    This topic created in 4362 days ago, the information mentioned may be changed or developed.
    文档是这样写的
    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 replies    2014-06-27 19:32:32 +08:00
    maguowei
        1
    maguowei  
       Jun 27, 2014   ❤️ 1
    对于现代的浏览器这样的伪静态对于seo应该没有多大影响了吧
    maguowei
        2
    maguowei  
       Jun 27, 2014
    @maguowei 浏览器->搜索引擎
    wesley
        3
    wesley  
       Jun 27, 2014   ❤️ 1
    你需要伪静态就加.html
    文档的意思可能是会混淆动静态文件
    multiple1902
        4
    multiple1902  
       Jun 27, 2014   ❤️ 1
    因为 .html 写在 URL 里面没有什么实际意义呀。一个网址是不是网页是 MIME Type 决定的,而不是后缀(扩展名)。后缀可能在本地文件系统里面有助于操作系统的文件关联,但在 URL 里看不出实际意义。

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

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

    明白了一些。多谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1006 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 23:16 · PVG 07:16 · LAX 16:16 · JFK 19:16
    ♥ Do have faith in what you're doing.