hi, i could need a pointer into the right direction regarding setup of url-rewrites for my domain.. i'm about to checkout if i could host my domains on virtuoso, but am currently struggling with url-rewrites.
what i want is basically redirection (303) to urls like ${entity-uri}.html
in case of accept:text/html or ${entity-uri}.ttl in case of
accept:text/turtle
what i also want is that document urls like ${entity-uri}.html override
accept headers and return the html representation (${entity-uri}.ttl should
simply return the turtle representation
regardless of the accept header)
what i have done so far :
1. edit /etc/hosts on my local machine to get some real feeling (
data.turnguard.com => localhost)
2. created a vhost with some rewrite rules (i've attached the export)
3. created a display.vsp that should (you guessed it) display the results
(it is attached)
my setting in principal seem to work :
when i enter in a browser
http://data.turnguard.com:8890/xxx => i get redirected to
http://data.turnguard.com:8890/xxx.html (via 303) => 200 OK.
http://data.turnguard.com:8890/xxx.html => 200 OK
http://data.turnguard.com:8890/xxx.ttl => 200 OK
this is all good... now for the curl
curl -v -L "http://data.turnguard.com:8890/test/xxx" (not redirected
correctly, but i know why, that's not the problem for now)
curl -v "http://data.turnguard.com:8890/test/xxx.html" 200 OK
curl -v "http://data.turnguard.com:8890/test/xxx.ttl" 200 OK
curl -v -L -H "accept:text/html" "http://data.turnguard.com:8890/test/xxx"
=> 303 See Other => xxx.html => 200 OK .. all good
BUT
curl -v -L -H "accept:text/turtle" "http://data.turnguard.com:8890/test/xxx"
does first a redirect (303) to http://data.turnguard.com:8890/test/xxx.ttl
as expected.
then there's the rewrite rule (internal redirect) for the display.vsp (see
attachement) with which i would itend to output a turtle representation of "
http://data.turnguard.com:8890/test/xxx",
but instead i get a turtle description of my display.vsp (ldp-wise)..
now the question is :
can i turn off ldp behaviour for certain directories?
is there another way to work around this?
any point really appreciated..
wkr j
| Jürgen Jakobitsch,
| Software Developer
| Semantic Web Company GmbH
| Mariahilfer Straße 70 / Neubaugasse 1, Top 8
| A - 1070 Wien, Austria
| Mob +43 676 62 12 710 | Fax +43.1.402 12 35 - 22
COMPANY INFORMATION
| web : http://www.semantic-web.at/
| foaf : http://company.semantic-web.at/person/juergen_jakobitsch
PERSONAL INFORMATION
| web : http://www.turnguard.com
| foaf : http://www.turnguard.com/turnguard
| g+ : https://plus.google.com/111233759991616358206/posts
| skype : jakobitsch-punkt
| xmlns:tg = "http://www.turnguard.com/turnguard#"
DB.DBA.VHOST_REMOVE (
lhost=>'*ini*',
vhost=>'data.turnguard.com',
lpath=>'/test'
);
DB.DBA.VHOST_DEFINE (
lhost=>'*ini*',
vhost=>'data.turnguard.com',
lpath=>'/test',
ppath=>'/DAV/home/dba/utils/display.vsp',
is_dav=>1,
def_page=>'',
vsp_user=>'dba',
ses_vars=>0,
opts=>vector ('browse_sheet', '', 'noinherit', 'yes', 'url_rewrite', 'http_rule_list_3'),
is_default_host=>0
);
DB.DBA.URLREWRITE_CREATE_RULELIST (
'http_rule_list_3', 1,
vector ('http_rule_5', 'http_rule_7', 'http_rule_6'));
DB.DBA.URLREWRITE_CREATE_REGEX_RULE (
'http_rule_5', 1,
'(.+?)(\.[^.]*$|$)',
vector ('par_1'),
1,
'%s.html',
vector ('par_1'),
NULL,
'(text/html)',
0,
303,
''
);
DB.DBA.URLREWRITE_CREATE_REGEX_RULE (
'http_rule_7', 1,
'(.+?)(\.[^.]*$|$)',
vector ('par_1'),
1,
'%s.ttl',
vector ('par_1'),
NULL,
'(text/turtle)',
0,
303,
''
);
DB.DBA.URLREWRITE_CREATE_REGEX_RULE (
'http_rule_6', 1,
'([^.*]+)(?=\.(html|ttl)+$)',
vector ('par_1', 'par_2'),
2,
'/display?entity=http://data.turnguard.com%s&accept=%U&ext=%s',
vector ('par_1', '*accept*', 'par_2'),
NULL,
'(.*)',
0,
0,
''
);
display.vsp
Description: Binary data
------------------------------------------------------------------------------ Want excitement? Manually upgrade your production database. When you want reliability, choose Perforce. Perforce version control. Predictably reliable. http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________ Virtuoso-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/virtuoso-users
