Help:Pretty URIs

If one wants to have pretty URIs (or "short URIs"), more compliant to linked data principles, some settings for MediaWiki and SemanticMediaWiki are necessary. Here is how it works, exemplified for .

Situation
Usually, Semantic MediaWiki automatically creates the respective URIs for all resources described, e.g. see Karlsruhe in :
 * Resource ID with content negotiation: https://sandbox.semantic-mediawiki.org/wiki/Special:URIResolver/Karlsruhe
 * HTML version: https://sandbox.semantic-mediawiki.org/wiki/Karlsruhe
 * RDF version: https://sandbox.semantic-mediawiki.org/wiki/Special:ExportRDF/Karlsruhe

Aim
However, you may want to have pretty URIs, e.g., see Karlsruhe in :
 * Resource ID with content negotiation: https://www.semantic-mediawiki.org/wiki/Special:URIResolver/Karlsruhe
 * HTML version: https://www.semantic-mediawiki.org/id/Karlsruhe
 * RDF version: https://www.semantic-mediawiki.org/wiki/Special:ExportRDF/Karlsruhe

The expected behaviour is that the RDF version forwards to the resource ID which in turn redirects to the HTML version.CiteRef::gh:smwo:26:307161649

Necessary steps
For that, using  as an example, one needs to do:

1) Add configuration for short URLs and for the semantic namespace to your "LocalSettings.php" file:

2) Define alias and rewrite rules in the VirtualHost (".conf" file) on the Apache webserver