Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional redirect for URL Rewrites feature #231

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

joseluisq
Copy link
Collaborator

Description

This PR introduces a new redirect option for the URL Rewrites feature via the config file.

The values can be:

  • 301 for "Moved Permanently"
  • 302 for "Found" (Temporary Redirect)

Example:

[advanced]

### URL Rewrites

[[advanced.rewrites]]
source = "**/*.{png,ico,gif}"
destination = "/assets/generic1.png"

[[advanced.rewrites]]
source = "**/*.{jpg,jpeg}"
destination = "/images/generic2.png"
# NOTE: it can also be omitted
redirect = 302

Related Issue

Motivation and Context

Relates to #228

How Has This Been Tested?

Screenshots (if appropriate):

@joseluisq joseluisq added enhancement New feature or request v2 v2 release advanced-feature Advanced feature only available via the configuration file labels Jun 26, 2023
@joseluisq joseluisq force-pushed the optional-redirect-for-url-rewrites branch from d5447b9 to 6825058 Compare June 26, 2023 19:45
the values can be:

- `301` for "Moved Permanently"
- `302` for "Found" (Temporary Redirect)

example:

```toml
[[advanced.rewrites]]
source = "**/*.{jpg,jpeg}"
destination = "/images/generic.png"
redirect = 301
```
@joseluisq joseluisq force-pushed the optional-redirect-for-url-rewrites branch from 6825058 to d70ae04 Compare June 26, 2023 19:48
@joseluisq joseluisq merged commit 06955e9 into master Jun 26, 2023
@joseluisq joseluisq deleted the optional-redirect-for-url-rewrites branch June 26, 2023 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advanced-feature Advanced feature only available via the configuration file enhancement New feature or request v2 v2 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant