Skip to content

ui-router-server / redirects / RedirectRule

Interface: RedirectRule

Defined in: redirects.ts:53

A when()-style rule: pathnames matching pattern redirect to to. Rules evaluate before state redirects, in declaration order. A string pattern compiles as a matcher pattern and its extracted params carry into the target (explicit target params win); a RegExp contributes no params.

Server redirects assume path-location clients. Hash-location apps keep route state in the fragment the server never sees, so a mount-root rule would rewrite the visible path on every entry — serve the shell at the mount root instead.

Properties

PropertyTypeDefined in
patternstring | RegExpredirects.ts:54
tostring | RedirectTargetredirects.ts:55