Skip to content

Instantly share code, notes, and snippets.

@musukvl
Created March 16, 2019 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save musukvl/66b4a5ca4ffd10cba56596f46ec94b80 to your computer and use it in GitHub Desktop.
Save musukvl/66b4a5ca4ffd10cba56596f46ec94b80 to your computer and use it in GitHub Desktop.
.htaccess file for asp.net core application
// # .htaccess content sample
// RewriteRule ^/apache-mod-rules-redirect/(.*) /redirected?id=$1 [L,R=302]
using (StreamReader apacheModRewriteStreamReader =
File.OpenText(".htaccess"))
{
var options = new RewriteOptions()
.AddApacheModRewrite(apacheModRewriteStreamReader);
app.UseRewriter(options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment