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

Nginx export of error rules #3850

Open
challet opened this issue Apr 23, 2024 · 1 comment
Open

Nginx export of error rules #3850

challet opened this issue Apr 23, 2024 · 1 comment

Comments

@challet
Copy link

challet commented Apr 23, 2024

Summary

Exporting an action_type=error rule to an nginx format makes it a temporary redirection to nowhere

Actual Behavior

$ wp redirection export nginx file.json --format=json

{
    "id": 89,
    "url": "/410",
    "match_url": "/410",
    "match_data": {
        "source": {
            "flag_query": "pass",
            "flag_case": false,
            "flag_trailing": false,
            "flag_regex": false
        }
    },
    "action_code": 410,
    "action_type": "error",
    "action_data": null,
    "match_type": "url",
    "regex": false,
    [ ]
},

$ wp redirection export nginx file.conf --format=nginx

rewrite ^/410$  redirect;

Expected Behavior

location /410 {
  return 410;
}

Steps to reproduce

  1. Set up a rule to answer with an error (4xx or 5xx) : redirection rule
  2. Export it to an nginx file through wp redirection export cli command
  3. Make nginx to load it : it doesn't complain about the missing replacement arg but it seems to just ignore the rule

Environment

Wordpress 6.5.2, Redirection 5.4.2

@challet
Copy link
Author

challet commented Apr 23, 2024

There seems to be a related pending PR #2669

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant