W3C home > Mailing lists > Public > public-lod@w3.org > July 2009

Re: .htaccess a major bottleneck to Semantic Web adoption / Was: Re: ?RDFa vs RDF/XML and content negotiation

From: Pierre-Antoine Champin <swlists-040405@champin.net>
Date: Sun, 05 Jul 2009 14:41:51 +0100
Message-ID: <4A50AD9F.9030904@champin.net>
To: Toby A Inkster <tai@g5n.co.uk>
CC: Danny Ayers <danny.ayers@gmail.com>, public-lod@w3.org, semantic-web@w3c.org
Note that I managed to have extension-less script run.

Recipe 2

(advantage over the 'index.php' recipe: works with slash based 
namespaces; disadvantage: 2 more lines in the .htaccess ;)

what you need is the following directive in .htaccess
(which is allowed by my webmaster)

   <Files myvoc>
     SetHandler application/x-httpd-php

(where myvoc is the name of your PHP file)

For CGI (resp. WSGI) scripts, replace "application/x-httpd-php" by 
"cgi-script" (resp. "wsgi-script").

so with the following layout

   .../mydir/myvoc (Toby's php script)

you would have the URI http://example.com/mydir/myvoc correctly 
redirecting to the appropriate representation.

Of course, you can have several vocabularies living in the same 
directory, all you need to do is add several <Files> directives to the 


PS: any IIS user volunteering to translate those recipies to IIS 

Le 05/07/2009 13:54, Toby A Inkster a écrit :
> On 5 Jul 2009, at 01:52, Pierre-Antoine Champin wrote:
>> I guess a PHP version would not even require that .htaccess, but
>> sorry, I'm not fluent in PHP ;)
> The situation with PHP should be much the same, though I suppose web
> hosts might be more likely to set index.php in the DirectoryIndex as a
> default.
> Anyway, I've done a quick port of your code to PHP. (I stripped out your
> connection negotiation code and replaced it with my own, as I figured
> out it would be faster to paste in the ConNeg class I'm familiar with
> rather than do line-by-line porting of the Python to PHP.) Here it is,
> same license - LGPL 3.
> We should start a repository somewhere of useful code for serving linked
> data.
Received on Sunday, 5 July 2009 13:42:42 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 24 March 2022 20:29:44 UTC