'Configuration of custom redirection with 301 status code in serverles.yml file
My problem is related to specific status code of permanent redirection in next.js. Status code that I want to achieve is 301, instead of default 308 which serverless provides.
After a lot of articles, I have found out that serverless has limitation in free version, and it isn't possible to use has property, which could eventualy allow me to configure serverles.yml file to redirect with 301 status code.
I am aware of similiraties with 301 and 308 status code, both of them will provide a permanent redirect, but in my case, I would like to customize redirection with 301 status code.
Is it possible to achive that? If someone has similar issue, please share with me. Thank you in advance!
Solution 1:[1]
You can send a response with this header:
return res.writeHeade(301, 'Location': '/targert-url'}
====> also check this article
Solution 2:[2]
Have you tried Ctrl+Space or hovering some code?
Also do you have "Visual Studio IntelliCode" extension installed?
If neither Ctrl+Space nor hovering work, it is recommended to restart VS Code (https://code.visualstudio.com/docs/editor/intellisense#_troubleshooting)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Moein moeinnia |
| Solution 2 | Keyne |
