Skip to content

Commit ef64224

Browse files
authored
Merge pull request #14 from martyf/fix/update-readme
Update readme for headers
2 parents e392654 + 3ded26b commit ef64224

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- Redirects to and from
88
- Set the status of redirects
9+
- Supports headers on redirects
910
- Regex Redirects
1011
- Imports and Exports
1112

@@ -19,33 +20,42 @@ composer require alt-design/alt-redirect
1920

2021
## Basic usage
2122

22-
### Simple redirects
23+
### Simple redirects
2324
Just take a request to one URL and redirect to a new url, for example
2425

25-
From :
26+
From :
2627
```
2728
/old-page
2829
```
29-
To :
30+
To :
3031
```
3132
/new-page
3233
```
3334

34-
### Regex redirects
35+
### Regex redirects
3536
These, other hand, allow much richer redirect functionality.
3637
Lets say you changed a wildcard URL path to be a query parameter on a new page, this can done like so
3738

38-
From :
39+
From :
3940
```
4041
/old-page/(.*)
4142
```
42-
To :
43+
To :
4344
```
4445
/new-page?wildcard=$1
4546
```
4647

4748
the '$x' (where x is a number) elements are arranged in the order the corresponding '(.*)' appeared in the 'From' URL, this allows rearranging the regexed fields in the 'To' URL.
4849

50+
### Headers on redirect
51+
You can add headers to the redirect response using the addon's config file. To get started, publish the config file to your site:
52+
53+
```bash
54+
php artisan vendor:publish --tag=alt-redirect-config
55+
```
56+
57+
In the `headers` property, you can provide an array of headers to be passed to the `redirect` method.
58+
4959
## Questions etc
5060

5161
Drop us a big shout-out if you have any questions, comments, or concerns. We're always looking to improve our addons, so if you have any feature requests, we'd love to hear them.

0 commit comments

Comments
 (0)