Nginx is an open-source HTTP web server and also the third most well-known web server for its performance. By using Nginx in your Linux VPS server, you have the ability to redirect the URL of a website to another address. To redirect your pages, you will first have Nginx web server installed in your VPS. In this article, we will be differentiating the difference between a temporary and permanent nginx redirect.
Redirection is the ability to forward a URL of your website to another address. Users will need redirect when switching a website from a content management system to another platform, which will make changes to the URL composition. To keep the website search ranking, or SERP position, you can reroute the old URL to the current new page.
Temporary Nginx Redirect
Temporary redirect means that it will only redirect your page to another link temporarily or within a period of time. The response code for this redirect is code 302, which is designed for the temporary movement of a page. One of the usages for this redirect is for maintaining the website, where you would not want any visitor to enter the site for the moment for various reasons until the maintenance is over. The route for this redirect is as follows:
Visitor -> Visit a website under maintenance -> Redirects to the maintenance notification page
Permanent Nginx Redirect
Permanent redirect means an old page or domain of yours will be linked permanently to a new page or domain. The response code for this redirect is code 301, which is designed for the permanent change in the movement of a page. The usage of this redirect is usually used when website owner changes their domain name and still wish for regular or old customer to visit their site. This enables visitors to be redirected to the new domain using the old domain. The route for this redirect is shown as follows:
Visitor -> Visits old domain “casbay.in” -> Redirects to new domain “casbay.com”