Skip to content

gertjvr/Owin.UrlRewrite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Owin UrlRewrite Build Status

An OWIN middleware that provides a way to modify incoming URL requests, dynamically, based on regular expression rules. This allows you to map arbitrary URLs onto your internal URL structure in any way you like, based on apache mod_rewrite

Using

See example project:

private class StartUp
{
    public void Configuration(IAppBuilder app)
    {
        app.UrlRewriter("!\\.\\w+$ /index.html [L]");

        app.UseStaticFiles();
    }
}

Flags

Last [L]

If a path matches, any subsequent rewrite rules will be disregarded.

Proxy [P] (Not Implemented Yet)

Proxy your requests '^/test/proxy/(.*)$ http://example.org/$1 [P]'

Redirect [R], [R=3**] (replace * with numbers)

Issue a redirect for request.

Nocase [NC]

Regex match will be case-insensitive.

Forbidden [F]

Gives a HTTP 403 forbidden response.

Gone [G]

Gives a HTTP 410 gone response.

Type [T=*] (replace * with mime-type)

Sets content-type to the specified one.

Host [H], [H=*] (replace * with a regular expression that match a hostname)

Match on host.

For more info about available flags, please go to the Apache page: http://httpd.apache.org/docs/current/rewrite/flags.html

####Continuous Integration from TeamCity Owin.UrlRewrite project is built & tested continuously by TeamCity (more details here). That applies to pull requests too. Shortly after you submit a PR you can check the build and test status notification on your PR. I would appreciate if you could send me green PRs.

####Author Gert Jansen van Rensburg (@gertjvr81)

About

Owin middleware to add modrewrite functionality

Resources

License

Stars

Watchers

Forks

Packages

No packages published