question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

return { redirect: { to: location, status: 301 } } makes no sense

See original GitHub issue

for errors, there’s already a top-level status property. we should use that for redirects as well.

ideas:

return {
  status: 301,
  redirect: '/elsewhere'
};
return {
  status: 301,
  location: '/elsewhere'
};
return {
  redirect: '/elsewhere' // 301 is implicit because 'redirect' exists
};

(We’re already using implicit status codes — it defaults to 200 if no redirect or error — but perhaps explicit is better in this case?)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Conduitrycommented, Feb 14, 2021

I would tend to not prefer 301 moved permanently as a default for anything because of the caching nightmare.

0reactions
Rich-Harriscommented, Mar 6, 2021

closed via #453

Read more comments on GitHub >

github_iconTop Results From Across the Web

301 Moved Permanently - HTTP - MDN Web Docs
The HyperText Transfer Protocol (HTTP) 301 Moved Permanently redirect status response code indicates that the requested resource has been ...
Read more >
What is a 301 Redirect, and When Should You Use One?
A 301 redirect passes all ranking power from the old URL to the new URL, and is most commonly used when a page...
Read more >
Why do I see 301 redirect every time I visit `http://www.iqueen ...
The HTTP response status code 301 Moved Permanently is used for permanent URL redirection, meaning current links or records using the URL ...
Read more >
301 Redirects for SEO: Everything You Need to Know - Ahrefs
A 301 redirect indicates the permanent moving of a web page from one location to another. The 301 part refers to the HTTP...
Read more >
What Is a 301 or 302 Redirect? | Domain.com | Blog
A 301 redirect is a status code that tells search engines and users the page has permanently moved, and makes sure that they...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found