20.3. URL Rewriting Revisited

Consider the namespace perspectives.domains. It’s Repository is associated with the database cw_perspectives_domains. In this database, we’ll find the ModelManifests for all models in the perspectives.domains namespace, like model://perspectives.domains#System. The URL of that ModelManifest can be derived directly from the model URI: https://perspectives.domains/cw_perspectives_domains/perspectives_domains-System.json.

Now consider the namespace joopringelberg.nl. Let’s suppose it’s Repository, too, is hosted in the CouchdbServer at https://perspectives.domains. Consequently, there will be a database cw_joopringelberg_nl holding the ModelManifests for models in this namespace, like for example model://joopringelberg.nl#MyModel. The PDR will derive the following URL for the ModelManifest for that model: https://joopringelberg.nl/cw_joopringelberg_nl/MyModel. But now we have a problem, because the manifest isn’t at joopringelberg.nl, it is at perspectives.domains!

We must solve this problem by rewriting the URL of the manifest on the server that hosts joopringelberg.nl. It should swap the authority of all ModelManifest urls with perspectives.domains. See this paragraph for how to configure Apache.


1. If no authoring role is provided by the API caller, we take it to be the System User.