.htaccess 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Turn off MultiViews
  2. Options -MultiViews
  3. # Directive to ensure *.rdf files served as appropriate content type,
  4. # if not present in main apache config
  5. AddType application/rdf+xml .rdf
  6. AddType application/rdf+xml .owl
  7. AddType text/turtle .ttl
  8. AddType application/n-triples .n3
  9. AddType application/ld+json .json
  10. # Rewrite engine setup
  11. RewriteEngine On
  12. #Change the path to the folder here
  13. RewriteBase /GDPRov
  14. # Rewrite rule to serve HTML content from the vocabulary URI if requested
  15. RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml.*(text/html|application/xhtml\+xml)
  16. RewriteCond %{HTTP_ACCEPT} text/html [OR]
  17. RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml [OR]
  18. RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.*
  19. RewriteRule ^$ index-en.html [R=303,L]
  20. # Rewrite rule to serve RDF/XML content from the vocabulary URI if requested
  21. RewriteCond %{HTTP_ACCEPT} \*/\* [OR]
  22. RewriteCond %{HTTP_ACCEPT} application/rdf\+xml
  23. RewriteRule ^$ ontology.xml [R=303,L]
  24. # Rewrite rule to serve N-Triples content from the vocabulary URI if requested
  25. RewriteCond %{HTTP_ACCEPT} application/n-triples
  26. RewriteRule ^$ ontology.nt [R=303,L]
  27. # Rewrite rule to serve TTL content from the vocabulary URI if requested
  28. RewriteCond %{HTTP_ACCEPT} text/turtle [OR]
  29. RewriteCond %{HTTP_ACCEPT} text/\* [OR]
  30. RewriteCond %{HTTP_ACCEPT} \*/turtle
  31. RewriteRule ^$ ontology.ttl [R=303,L]
  32. RewriteCond %{HTTP_ACCEPT} .+
  33. RewriteRule ^$ 406.html [R=406,L]
  34. # Default response
  35. # ---------------------------
  36. # Rewrite rule to serve the RDF/XML content from the vocabulary URI by default
  37. RewriteRule ^$ ontology.xml [R=303,L]