Expand description
Actix-Web Middleware designed to replicate HTTPd’s mod_rewrite.
§Example
use actix_web::App;
use actix_rewrite::Engine;
let mut engine = Engine::new();
engine.add_rules(r#"
RewriteRule /file/(.*) /tmp/$1 [L]
RewriteRule /redirect/(.*) /location/$1 [R=302]
RewriteRule /blocked/(.*) - [F]
"#).expect("failed to process rules");
let app = App::new()
.wrap(engine.middleware());§Documentation
Information regarding the Rewrite expression language can be found in the mod_rewrite manual.
Documentation for this crate can be found on docs.rs.
Modules§
- util
- Utiliies Used for Actix ModRewrite
Structs§
- Engine
- Actix-Web compatible wrapper on
Engine - Middleware
mod_rewritemiddleware service- Rewrite
Service - Assembled
mod_rewriteservice - Server
Ctx - All variables and references associated with
SERVER_prefix and other server attributes.