AllContent Marketing

How to Set Up Redirects on Your Website

Redirects are important for website owners because they allow traffic to be forwarded from an old URL to a new one when the old URL is no longer accessible. Redirects come in two main categories: permanent and temporary. Permanent redirects tell search engines that it is okay to remove the old URL from their search results and replace it with the new one. In contrast, temporary redirects do not notify search engines of the change and as a result, the old URL remains in the search results. The appropriate type of redirect to use depends on the situation. If you want to keep the old URL in Google's index for longer, use a temporary redirect. A 301 redirect tells Google that the redirect is permanent, while a 302 redirect signals that the move is only temporary. If you need to redirect a page and want to preserve link equity, use a 302 redirect. You would use a 302 redirect if you were temporarily moving your page to a new URL or if you wanted to A/B test new website design or copy. For more information on each redirect type, read our guide to 301 redirects. If you can't use a server-side redirect, Google only recommends using a HTTP redirect over a meta refresh. There are two types of redirects- instant and delayed. JavaScript redirects happen on the client side rather than the server side and may hurt your website's ranking in search results. For more information on setting up redirects on WordPress, read our in-depth guide to redirects. The mode_rewrite module can be found in Apache by default. If you want users to access the "www" subdomain, you can redirect them to the URL with www included. Redirects can be set up with a file called .htaccess. You can also set up redirects manually using a.ht access file on Apache servers. Use the code below to redirect a single URL and redirect a new URL to a new. folder. If users (or search engines) try to reach URLs without the .www subdomain, you'll need to redirect them to the .www URL. If a server sends a "200 OK" HTTP status code, but Google suspects the page should return a 404 error, it's called a soft 404. This can causeissues with website crawling, link equity, and page loading time. Redirect chains occur when more than one URL redirect exists between the original URL and the final URL. To fix a soft 404 caused by redirects, update the redirect so it points to the most relevant page available. To avoid redirect chains, choose the most relevant page and ensure all other pages redirect to it. When you change a URL on your website, any links pointing to the old URL will stop working. This is because when you change a URL, you effectively create a new page with new content, and the old URL now points to a page that doesn't exist anymore (a 404 error). This can cause problems with your website's SEO because Google will ignore any backlinks that point to a 404 page. If you want to avoid this problem, you can use redirects. Redirects are a way of telling the browser that when someone tries to access the old URL, they should be taken to the new URL instead. This ensures that anyone trying to access your content will always be taken to the most up-to-date version of it, and it also prevents any issues with duplicate content. If you're not sure whether or not you have any duplicate content on your website, you can check using our Site Audit tool. This tool will show you any pages on your site that have the same or similar content. If you do have duplicate content, you can use redirects to fix the problem. If you take down a webpage or move it to a new URL without setting up a redirect, users and Google will see a 404 error. Google's Gary Illyes says you should keep redirects in place for at least a year. Redirects help preserve a page's ranking on search engines by passing authority from the old page to the new one if the content is similar. So in this case, it's best to set up redirects to protect your current rankings.

(source: https://www.semrush.com/blog/redirects)