Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/huskydog9988/simple-redirect
Redirects users while attempting to preserve the desired page
https://github.com/huskydog9988/simple-redirect
go golang redirector toy-project
Last synced: 7 days ago
JSON representation
Redirects users while attempting to preserve the desired page
- Host: GitHub
- URL: https://github.com/huskydog9988/simple-redirect
- Owner: Huskydog9988
- License: mit
- Created: 2022-07-06T01:02:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-23T17:58:09.000Z (9 months ago)
- Last Synced: 2024-11-16T08:41:54.594Z (2 months ago)
- Topics: go, golang, redirector, toy-project
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple Redirect
Permanently redirects users from the current URI to the new one.
Not only does it redirect them, but attempts to preserve their desired page during the redirect. For example, a user visting `https://example.com/home`, would be redirected to `https://example2.com/home`. This enables quick and dirty hostname migrations with minimal impact to users.
## Environment Variables
| Variable | Description |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `REDIRECT_To` | **(Required)** Specifies hostname to redirect too. _(Should be no trailing `/`)_ |
| `PORT` | Changes the port the server runs on |
| `PERMANENT` | Whether the redirect should be [permanent](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308) or [not](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/307) |