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

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
   </Files>

(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/.htaccess
   .../mydir/myvoc (Toby's php script)
   .../mydir/myvoc.html
   .../mydir/myvoc.rdf

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 
.htaccess.

   pa

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

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