# URL Generation Strategy By default, API Platform generates all URLs as absolute paths to the base URL. For instance, in JSON-LD, you will get a collection like this: ```json { "@context": "/contexts/Book", "@id": "/books", "@type": "Collection", "member": [ { "@id": "/books/1", "@type": "https://schema.org/Book", "name": "My awesome book" } ], "totalItems": 1 } ``` You may want to use absolute URLs (for instance if resources are used in another API) or network paths instead. ## Configure URL Generation Globally It can be configured globally using one of the configurations below: ### Configure URL Generation Globally using Symfony ```yaml # api/config/packages/api_platform.yaml api_platform: defaults: url_generation_strategy: !php/const ApiPlatform\Metadata\UrlGeneratorInterface::ABS_URL ``` ### Configure URL Generation Globally using Laravel ```php [ 'url_generation_strategy' => ApiPlatform\Metadata\UrlGeneratorInterface::ABS_URL ], ]; ``` ## Configure URL Generation for a Specific Resource It can also be configured only for a specific resource: ```php ``` For the above configuration, the collection will be like this: ```json { "@context": "http://example.com/contexts/Book", "@id": "http://example.com/books", "@type": "Collection", "member": [ { "@id": "http://example.com/books/1", "@type": "https://schema.org/Book", "name": "My awesome book" } ], "totalItems": 1 } ```