forked from nextcloud/server
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[POC] (C11N) lib/base: add "redirect" config
WIP: Tests need to be written The "redirects" config allows configuring redirects from paths to routes. Example config: "redirects" => { "^/path/regexp" => "an.apps.controller.route.locator" } Use case: * An administrator can configure another app as target for certain paths. Differentiation from Apache redirects: * this allows configuring redirects in one place and avoids spreading the configuration in multiple places. * the target route locator is more expressive/easier to trace than a path
- Loading branch information
1 parent
1e4e848
commit dc535a0
Showing
2 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
$CONFIG = [ | ||
'redirects' => [ | ||
// Request path without /index.php/ maps to a controller path in the form | ||
// <app name>.<controller name>.<handler>. | ||
|
||
// - For a FooController.php the controller name is "foo" (lowercase) | ||
// - A handler would be a method in FooController that was annotated with | ||
// - either #[FrontpageRoute] attribute | ||
// - or configured in routes.php | ||
'^\/settings' => 'acmesettings.page.index' | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters