【问题标题】:How to write a simple content negotiation with apache如何用apache写一个简单的内容协商
【发布时间】:2014-04-29 14:48:38
【问题描述】:

我想写一条规则说,每当请求该资源时,如果内容类型是 X,则返回 file_x,如果是 Y,则返回 file_Y

有人可以帮忙吗?

非常感谢,

-D-

【问题讨论】:

    标签: apache content-negotiation linked-data


    【解决方案1】:

    除了your other question 中提到的内容之外,另一种选择是使用type map file。例如,我使用以下文件类型映射来提供我的 foaf 配置文件。

    URI: card
    
    URI: card.ttl
    Content-type: text/turtle; qs=1.0
    
    URI: card.rdf
    Content-type: application/rdf+xml; qs=0.8
    
    URI: card.html
    Content-type: text/html; qs=0.8
    
    URI: card.trix
    Content-type: application/trix; qs=0.8
    
    URI: card.trig
    Content-type: application/x-trig; qs=0.8
    
    URI: card.n3
    Content-type: text/rdf+n3; qs=0.8
    
    URI: card.nt
    Content-type: text/plain; qs=0.8
    

    这里是文件。 http://people.apache.org/~nandana/id/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-05
      • 2012-08-13
      • 1970-01-01
      • 1970-01-01
      • 2010-11-08
      相关资源
      最近更新 更多