Download the PHP package lazychanger/urlrewrite without Composer
On this page you can find all versions of the php package lazychanger/urlrewrite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download lazychanger/urlrewrite
More information about lazychanger/urlrewrite
Files in lazychanger/urlrewrite
Download lazychanger/urlrewrite
More information about lazychanger/urlrewrite
Files in lazychanger/urlrewrite
Vendor lazychanger
Package urlrewrite
Short Description Easy and quickly add url rewrite with psr/http-message
License MIT
Homepage https://github.com/lazychanger/urlrewrite
Package urlrewrite
Short Description Easy and quickly add url rewrite with psr/http-message
License MIT
Homepage https://github.com/lazychanger/urlrewrite
Please rate this library. Is it a good library?
Informations about the package urlrewrite
UrlRewrite
Introduction
Easy, simple and elegant way to add http rewrite rule with psr/http-message
.
UrlRewriteRule
name | comment |
---|---|
matchPath | match path prefix or exact path |
matchHost | match request header Host |
regMatchPath | use regexp match path |
regMatchHost | use regexp match host |
matchMethod | match request method,not allowed to be used alone |
How to Use
Match the prefix path
- match:
/enter
=>/rewrite
- match:
/enter/foo
=>/rewrite/foo
- match:
/enter1/foo
=>/rewrite1/foo
- nomatch:
/nomatch/foo
=>/nomatch/foo
Match the exact path
- match:
/enter
=>/rewrite
- nomatch:
/enter/foo
=>/enter/foo
Match host
- match:
example.com/enter
=>example.com/rewrite
- match:
example.com/enter/foo
=>example.com/rewrite
- nomatch
sub.example.com/enter/foo
=>sub.example.com/enter/foo
Use regexp match host
- match:
sub.example.com/user/1
=>sub.example.com/rewrite/sub/1
- match:
sub2.example.com/user/2
=>sub.example.com/rewrite/sub2/2
- nomatch:
example.com/enter/foo
=>example.com/enter/foo
- nomatch:
sub.example.com/user/foo
=>sub.example.com/user/foo
Q&A
How can i got old path
Obtain through the request header X-Real-Path
, just rewriteTo
, no rewriteToFn
How to use in hyperf
-
Require package and publish config
- Replace CoreMiddleware in
config/autoload/dependencies.php
or add the code to your CoreMiddleware
Thanks
- Regexp Route Parse nikic/fast-route
All versions of urlrewrite with dependencies
PHP Build Version
Package Version
The package lazychanger/urlrewrite contains the following files
Loading the files please wait ....