redirection
redirection copied to clipboard
Nginx export of error rules
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
- Set up a rule to answer with an error (4xx or 5xx) :
- Export it to an nginx file through
wp redirection exportcli command - 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
There seems to be a related pending PR #2669