I am looking for a way to rewrite the url in case the application path in the url has a different casing. Since the application path can vary for different deployments, I need to access it dynamically. Is there any way of doing it? 

**Background:**

I am setting path of cookies to the application path. Since cookie path is case sensitive, I need to rewrite urls in case they are wrongly cased. I would also like to have alternate ways that do not need the use of the url rewrite module.

**Example**

Let's assume that for one deployment, the alias for the application is "ApplicationA" (for another deployment, the alias may be "ApplicationB"). 

```
http://<host>:<port>/<applicationA or Applicationa or APPLicationA etc.>/<rest of the url>

Redirect to 

http://<host>:<port>/ApplicationA/<rest of the url>

```