mirror of
https://github.com/WilliamAAK/Route2.git
synced 2025-04-19 12:47:20 +00:00
Docs: update
This commit is contained in:
parent
25ad36a9aa
commit
f9b451ef48
28
README.md
28
README.md
@ -57,7 +57,7 @@ Route::group('/admin', function () {
|
|||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
## Composer
|
### Composer:
|
||||||
|
|
||||||
Composer needs to know where to locate the package. Add the repository to your project by declaring it in the `composer.json` file.
|
Composer needs to know where to locate the package. Add the repository to your project by declaring it in the `composer.json` file.
|
||||||
```json
|
```json
|
||||||
@ -77,7 +77,7 @@ Fetch the package by running
|
|||||||
|
|
||||||
composer install
|
composer install
|
||||||
|
|
||||||
## Manual
|
### Manual:
|
||||||
|
|
||||||
Its all in a single file; include it in your project like so.
|
Its all in a single file; include it in your project like so.
|
||||||
|
|
||||||
@ -102,29 +102,29 @@ http_response_code(404);
|
|||||||
<h1>Page not found!</h1>
|
<h1>Page not found!</h1>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Access directly
|
### Access directly:
|
||||||
|
|
||||||
The simplest way to access your routes, put the file in your favorite folder and run it!
|
The simplest way to access your routes, put the file in your favorite folder and run it! E.g if you request `http://your.site/yourscript.php/your/route` the route will be automatically converted to `/your/route`
|
||||||
|
|
||||||
If you request `http://your.site/yourscript.php/your/route` the route will be automatically converted to `/your/route`
|
### Rewrite requests:
|
||||||
|
|
||||||
## Rewrite requests
|
|
||||||
|
|
||||||
Want to hide that pesky script name (e.g `index.php`) from the URL?
|
Want to hide that pesky script name (e.g `index.php`) from the URL?
|
||||||
|
|
||||||
### FrankenPHP
|
#### FrankenPHP:
|
||||||
|
|
||||||
It is recommended that you use FrankenPHP the modern PHP app server. This behavior is enabled by default.
|
It is recommended that you use FrankenPHP the modern PHP app server. This behavior is enabled by default.
|
||||||
|
|
||||||
### NGINX
|
#### NGINX:
|
||||||
|
|
||||||
With PHP already installed and configured you may add this to the server block of your configuration to make requests that don't match a file on your server to be redirected to `index.php`
|
With PHP already installed and configured you may add this to the server block of your configuration to make requests that don't match a file on your server to be redirected to `index.php`
|
||||||
|
|
||||||
location / {
|
```nginx
|
||||||
try_files $uri $uri/ /index.php?$query_string;
|
location / {
|
||||||
}
|
try_files $uri $uri/ /index.php?$query_string;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Apache
|
#### Apache:
|
||||||
|
|
||||||
Make sure that mod_rewrite is installed on Apache. On a unix system you can just do
|
Make sure that mod_rewrite is installed on Apache. On a unix system you can just do
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ Make sure that mod_rewrite is installed on Apache. On a unix system you can just
|
|||||||
|
|
||||||
This snippet in your .htaccess will ensure that all requests for files and folders that does not exists will be redirected to `index.php`
|
This snippet in your .htaccess will ensure that all requests for files and folders that does not exists will be redirected to `index.php`
|
||||||
|
|
||||||
```
|
```apache
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
Loading…
x
Reference in New Issue
Block a user