Skip to Content

URL rewriting


Some environments utilize URL rewriting. A typical use case for URL rewriting maps the web root:

To a sub-directory:

From the browser's perspective, Vinyl is hosted directly beneath the web root. From the server's perspective, Vinyl's hosted in a sub-directory. This incongruity causes problems, particularly with cookies. Browsers take into account the path when determining whether or not to send a cookie to the server.

Vinyl has support for automatically detecting and correcting for URL rewriting. By default, Vinyl will check for the X-Original-URL header. This header is typically set by URL rewrite modules. If present, Vinyl will use the header to determine the correct path.


Name Description Example
OriginalUrlHeader URL prior to any rewriting. X-Original-URL

Example configuration

    <add key="OriginalUrlHeader" value="X-Original-URL" />

Amazon Web Services

In an Amazon Elastic Beanstalk environment, URLs are rewritten by default using the IIS URL Rewrite Module. The IIS URL Rewrite Module sets the X-Original-URL header. No additional configuration is necessary.