79579278

Date: 2025-04-17 13:01:32
Score: 1
Natty:
Report link

I achieved exactly that this way:

for (var { source, destination } of redirects) {
    if (source.test(request.uri)) {
       request.uri = request.uri.replace(source, destination);
...
...
return {
        status: '301',
        statusDescription: 'Moved Permanently',
        headers: {
          location: [{ value: request.uri }]
Reasons:
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: djook