Websites

URL forwarding 101: everything you need to know about redirects

Apr 14, 2025
18 min read
URL forwarding 101: everything you need to know about redirects

URL forwarding (also known as URL redirection) helps users and search engines find the content they need, even if its location has changed. Setting up redirects correctly improves user experience and preserves your SEO reputation by preventing traffic loss. In this article, we’ll cover the basics of URL redirection.

What is URL forwarding?

URL forwarding (also known as a redirect) is a mechanism that automatically directs users and search engines from one web address to another. Imagine you type your usual address into the browser, but the site instantly takes you to a different page — that’s a redirect in action.

Redirects work similarly to mail forwarding: if someone moves to a new address but doesn’t want to lose their mail, they set up mail forwarding. The same principle applies on the internet: if a page has moved, but users and search engines continue to look for it at the old address, a redirect prevents a 404 error (“Page not found”) and ensures smooth navigation.

Understanding redirects

When a user types a web address into a browser or clicks on a link, the browser sends a request to the server where the site is hosted. If the page has been moved or deleted, the server responds by redirecting the user to the new URL using a redirect.

Technically, a redirect is a server instruction telling a browser or search engine where to go. It can be temporary (for example, during site maintenance) or permanent (when a page has permanently moved to a new address).

How does a browser know it is being redirected?

When a server receives a request to access a page, it can respond with a special HTTP status code:

  • 301 Moved Permanently – This indicates that the page has moved permanently to a new location.
  • 302 Found (or 307 Temporary Redirect) This is a temporary redirect used when the page is unavailable or its address may change in the future.
  • 308 Permanent Redirect This is similar to a 301 redirect but with a slight technical difference; it requires the request method to remain unchanged.

After receiving one of these status codes, the browser automatically loads the new URL without requiring any action from the user.

Where can I set up a redirect?

You can set up redirects in several ways:

  1. In server configuration files:
  • Apache: use the .htaccess file
  • Nginx: configure it in the server’s configuration file.
  • IIS (Microsoft): adjust the settings in the web server.
  1. Using code on the site side:
  • In PHP, you can use header(“Location: newpage.html”, true, 301);
  • In JavaScript you can implement window.location.replace(“https://example.com”);
  1. Via plugins or CMS settings:
  • Platforms like WordPress, Joomla, and others offer built-in tools or plugins for easy redirect management.

Types of redirects

301 redirects (Permanent)

A 301 redirect is an HTTP status code that informs browsers and search engines that a page has been permanently moved to a new URL. This means that all traffic and SEO value from the old page is transferred to the new one. 

Here are some scenarios where 301 redirects should be used:

  • Changing the URL structure. If you’ve updated your site and changed the URLs, it’s crucial to redirect users and search engines to the new URLs. For example, Wikipedia frequently updates its URL structure, adding new formats. Articles that previously had URLs like https://en.wikipedia.org/wiki/Best_movies_of_2020 later changed to https://en.wikipedia.org/wiki/Best_movies_2020 
  • Moving a site to a new domain. If your brand changes its domain name, 301 redirects will help maintain your rankings in search results. In 2023, Twitter rebranded to X and migrated its domain from twitter.com to x.com. To retain billions of visits, Twitter set up a 301 redirect from  https://twitter.com to https://x.com
  • Combining multiple pages into one.  If you have two similar articles and decide to consolidate them, a 301 redirect can guide users to the new, comprehensive page.

 For instance, HubSpot realized they had several articles on the same topic, such as “Best SEO Tools,” “TOP SEO Plugins for WordPress,” and “How to Improve Website SEO.” They combined these into one detailed article at https://blog.hubspot.com/seo-tools, redirecting all the old articles to the new URL via a 301.

  • Switching from HTTP to HTTPS. This ensures that search engines and users are automatically directed to a secure site. 

In 2014, Google announced that HTTPS would be a ranking factor. Many sites, including YouTube, switched from http:// to https://, implementing a 301 redirect so that all old HTTP URLs are automatically redirected to their secure HTTPS counterparts.

  • Removing old pages. If a page no longer exists but has a relevant replacement, redirecting users to that page helps avoid a 404 error.

302 redirects (Temporary)

A 302 redirect is an HTTP status code indicating that a page has temporarily moved and will return. Unlike a 301 redirect, a 302 does not pass SEO value to the new URL, as search engines expect the original address to be available again. 

Here are some scenarios where 302 redirects are used:

  • A page is temporarily unavailable. If a site is undergoing maintenance or updates. 

For instance, in 2022, Netflix had a major platform update and temporarily redirected users to the maintenance page at https://netflix.com/maintenance to prevent them from encountering a 404 error.

  • A/B testing. When testing different versions of pages, you may not want search engines to index the test URL instead of the original one. Amazon regularly tests various page designs to determine which version converts better. For example, one group (Group A) sees the standard product page, while another group (Group B) sees a new design with larger buttons.
  • Redirecting users by geolocation. This is useful when the site automatically routes visitors to different versions based on their location. 

For example, when a user visits apple.com, they are automatically redirected to the local version of the site: in the US to apple.com/us/, in France to apple.com/fr/, and in Hungary to apple.com/hu/.

303 redirects (See Other)

A 303 redirect is an HTTP status code that indicates the requested resource is located at a different URL and must be accessed via a GET request, even if the original request was a POST. 

This redirect is often used when the server receives a POST request (e.g., submitting a form) and wants to avoid resending the request if the user refreshes the page. 

Here’s when to use a 303 redirect:

  • After a Form Submission: To prevent duplicate submissions if the user refreshes the page.
  • Redirecting to a Confirmation Page: After successful registration or payment.
  • In REST APIs: When the server returns a different resource but does not want the client to repeat the original POST request.

307 redirects (Temporary)

A 307 redirect is an improved version of the 302 redirect. Unlike a 302, it preserves the request method (e.g., if it was POST, it remains POST). 

Here’s when to use a 307 redirect:

  • When a temporary redirect is needed, but preserving the request method is of utmost importance

For example, during a bank transfer, you enter the amount and click “Submit”. If the bank temporarily moves payment processing to another server, it applies a 307 redirect to ensure the request method remains POST.

How it works:

  1. You enter the amount and click “Transfer” (POST).
  2. The bank redirects your request to a new URL (e.g., bank.com/new-transfer) with a 307 redirect.
  3. The browser saves the POST request and sends it to the new server.
  4. Your transfer goes through without requiring you to re-enter your data.
  • When the page is temporarily moved (e.g., during maintenance).
  • In API requests, when the client must resend the request with the same method.

308 redirects (Permanent)

A 308 redirect is an improved version of the 301 redirect that, in addition to being a permanent redirect, ensures that the request method is preserved. Like a 301 redirect, it informs search engines that the page has permanently moved. 

However, unlike a 301 redirect, a 308 redirect does not allow changing the request method (for example, it keeps POST as POST instead of converting it to GET).

When to Use 308 Redirects:

  • When the Page Has Been Permanently Moved: Use a 308 redirect when it’s essential to preserve the request method.
  • For APIs: This is particularly important when the POST request must remain a POST and should not be converted into a GET.
  • When Redesigning the URL Structure: If your new URL structure includes POST requests, a 308 redirect ensures that the request method is maintained.
CodeTypePreserves request method?SEO valueWhen to use?
301PermanentNoIs passedPermanently moved page
302TemporaryNoDoes not passTemporary redirect without preserving method
303TemporaryNo (converts POST into GET)Does not passAfter POST requests to avoid resubmission
307TemporaryYesDoes not passTemporary redirect with preserving method
308PermanentYesIs passedPermanent move with preserving method

When to use URL forwarding and redirects

Website migrations

When moving a site to a new domain, changing the URL structure, or switching from HTTP to HTTPS, setting up a 301 redirect is crucial. This ensures that all old pages automatically redirect to their corresponding new ones. 

For example, if a site previously operated at http://example.com and now runs at https://example.com, you should implement a 301 redirect to automatically redirect all HTTP requests to HTTPS. This approach preserves the SEO value of the pages, directs users to the correct version of the site, and reduces the likelihood of encountering 404 errors.

In 2015, Wikipedia made the switch from HTTP to HTTPS for all users to enhance security, protect user data, and improve search rankings (as Google prioritizes HTTPS sites). So every HTTP request (e.g., http://en.wikipedia.org) was automatically redirected to HTTPS (https://en.wikipedia.org) using a 301 redirect, preserving SEO value and preventing traffic loss.

Changing domain names

If a company is rebranding and changing its domain name, it’s essential to set up 301 redirects from the old domain to the new one. This ensures that users and search engines can smoothly transition to the new site. For example, if the site oldbrand.com changes its domain to newbrand.com, it’s important to redirect all pages to prevent visitors from getting lost and to help search engines recognize the new address.

In 2023, Twitter, uhm, “rebranded” and changed its domain from twitter.com to x.com. All pages (e.g., twitter.com/user, twitter.com/home) were redirected to x.com/user and x.com/home using 301 redirects.

Fixing broken links

If a page has been removed or relocated but links continue to direct traffic to it, it’s essential to redirect users to relevant content. If there is a similar page, you can use a 301 redirect. If the page has been permanently deleted and there is no alternative, it’s best to return a 410 (Gone) response code so that search engines recognize it as removed.

For example, if the page example.com/best-smartphones-2023 is outdated but there is a new version at example.com/best-smartphones-2024, you should set up a 301 redirect to the new page. If there is no equivalent page, users can be redirected to the homepage or another suitable section of the site.

Consolidating content

When multiple similar pages exist on the site, it’s more effective to combine them into one to eliminate duplicate content. 

For instance, if there were three separate pages (super-duper-iphone-store.com/iphone-11-review, super-duper-iphone-store.com/iphone-11-pro-review, and super-duper-iphone-store.com/iphone-11-comparison) and now all content is consolidated on super-duper-iphone-store.com/iphone-11, it’s important to set up 301 redirects to retain SEO value.

Seasonal promotions or temporary campaigns

For limited-time promotions, such as Black Friday, you can use a 302 redirect to temporarily send users to a promotional page. 

For example, if a store wants visitors in the Smartphones category to be automatically redirected to a Black Friday deals page at example.com/black-friday-deals, it should set up a 302 redirect. 

After the promotion ends, the redirect can be removed, and the original page will once again be accessible.

A/B testing

When testing different versions of a page, you can use a 302 redirect to direct some users to a test version while ensuring the original page remains indexed. 

For example, if you are testing two versions of a landing page — example.com/landing-a (the original version) and example.com/landing-b (the new version) — you can randomly split traffic between them. 

This allows you to evaluate the new version without modifying the main page. Once the test is complete, you can remove the redirect and implement the best-performing version.

Changing URL structures

If a site updates its URL structure for better organization or SEO, it’s important to set up 301 redirects so that users and search engines do not lose access to the new addresses. 

For example, if the old URL was example.com/2023/10/new-products, and it has now changed to example.com/new-products, the old URL should be redirected to the new one. 

Similarly, if an online store previously categorized phones under example.com/electronics/phones/iphone-12, but now uses example.com/smartphones/iphone-12, it’s critical to set up a 301 redirect to preserve organic traffic and avoid 404 errors.

Redirecting to mobile versions

If the site has a separate mobile version, such as m.example.com, you can set up a 302 redirect to automatically direct users to the optimized version. 

Device detection can be done using JavaScript or server-side rules in Apache or Nginx.

For example, if a user visits your site on a mobile device, a redirect can send them from example.com/page to m.example.com/page. This improves user experience, reduces bounce rates, and increases conversions. 

When users visit facebook.com on a phone, they are automatically redirected to m.facebook.com.

Handling typos or misspellings

To avoid traffic loss due to common typos, you can set up 301 redirects to route users to the correct pages. 

For example, if the URL used to be example.com/fotography, but the correct address is now example.com/photography, you should set up a 301 redirect. 

Similarly, you can redirect incorrectly typed domains. If a site is available at both example.net and example.com, but the main domain is example.com, you can automatically direct traffic from example.net to example.com.

Google has proactively acquired domains like gooogle.com, gogle.com, and googl.com to prevent traffic loss from user typos. All variations redirect users to google.com.

Best practices for implementing redirects

Setting up redirects is an integral part of managing your site, especially when changing URLs, redesigning, or merging pages. However, misconfiguring redirects can negatively impact SEO, user experience, and site loading speed.

Tips for setting up redirects correctly

  1. Choose the correct redirect type:
  • 301 (Permanent). Use this when the URL has changed permanently.
  • 302 (Temporary). Use this if the page is temporarily unavailable.
  • 307 (Temporary, preserves the request method). Use this when it’s essential to keep the original method (POST, GET).
  • 308 (Permanent, preserves the request method). Use this when the URL has changed permanently, and the request method should remain the same.
  • 303 (See Other). Use this to redirect the user to a GET request after a POST request.
  1. Redirect users to the most relevant content, not just the homepage.

Instead of simply redirecting to your homepage or the category page, direct users to the most relevant content. 

For example, if an article about “Best Smartphones of 2024” is removed, it’s better to redirect users to “Best Smartphones of 2025” rather than just /smartphones.

  1. Set up redirects at the server level

Redirects configured at the server level using .htaccess (Apache), nginx.conf (Nginx), or PHP execute faster than JavaScript redirects, which require the page to load first.

  1. Redirect HTTP to HTTPS

If your site is running on HTTPS, ensure that all users are redirected from HTTP to the secure protocol.

The importance of testing redirects

Mistakes in redirects can lead to issues such as 404 errors, lower search rankings, or incorrect user routing. Therefore, it’s important to test redirects before deploying them. 

Here’s how to do it:

  1. Use tools to test redirects:
  • Google Search Console. Check for indexing errors.
  • Screaming Frog SEO Spider. Analyze all redirects on the site.
  • Redirect Checker (httpstatus.io). Check HTTP responses and redirect chains.
  • Browser DevTools (Chrome, Firefox). Use the “Network” tab to view redirect status codes.
  1. Check where the redirect leads to.

Sometimes redirects can take users to the wrong pages. Use the curl command in the terminal to check the server’s response.

  1. Test on different devices and browsers

Redirect behavior may vary based on the device and browser. Ensure you check functionality on desktops, mobile phones, and various browsers.

Avoiding redirect chains and loops

A redirect chain is a sequence of multiple redirects, such as: Page A → Page B → Page C → Page D (the final page). These chains can slow down your site’s loading time, add unnecessary load on the server, and negatively impact SEO, as search engines may not reach the final page. 

To resolve a redirect chain, ensure that Page A redirects directly to Page D, bypassing the unnecessary intermediate steps.

A redirect loop occurs when two pages continuously redirect to each other, creating an infinite loop, such as: Page A → Page B → Page A → Page B → (and so on). This results in an infinite loop and can trigger the ERR_TOO_MANY_REDIRECTS error.

To avoid these issues, regularly audit your redirects and ensure they are configured correctly. This will help maintain optimal site performance and a positive user experience.

How to fix redirect loops?

  • Check .htaccess or nginx.conf for duplicate redirects.
  • Use conditions in Apache/Nginx to exclude repeated redirects.

Impact of redirects on SEO

Redirects play an important role in SEO as they help maintain traffic, preserve link equity, and protect search rankings. However, not all redirects function the same way.

Best options for SEO: 301 and 308 redirects

  • 301 redirect: This permanent redirect informs search engines that the page has been moved permanently to a new address. It transfers 90-99% of the original page’s link authority and updates the search engine index by replacing the old URL with the new one. This allows the page to maintain its search rankings!
  • 308 redirect: This redirect works similarly to a 301 but preserves the request method. Like the 301, it transfers SEO value and PageRank and is used when the request method is important.

Temporary redirects: 302 and 307.

302 redirect:

  • Notifies search engines that the page has been temporarily moved.
  • Does NOT transfer PageRank, since search engines continue to index the original URL.
  • Commonly used for site maintenance, seasonal promotions, and temporary content changes. Also is useful for A/B testing!

NOTE! When using 302 redirect, the original URL remains indexed and can confuse search engines. The new URL does not receive link authority! 

307 redirect:

  • Notifies search engines that the page has been temporarily moved.
  • Does NOT transfer PageRank, as search engines continue to index the original URL.
  • Commonly used for site maintenance, seasonal promotions, and temporary content changes. It is also useful for A/B testing.

NOTE! Like the 302 redirect, it does not pass PageRank.

303 redirect:

This redirect also does NOT affect SEO. It is useful for login authentication, form submissions, and payment confirmation pages. It is used after POST requests to prevent duplicate form submissions and always redirects the user to a GET request.

How to preserve link authority?

  1. Use 301 for Permanent Redirects: This type passes up to 99% of link authority.
  2. Avoid 302 for Important Pages: Since it does NOT pass PageRank, it’s best to use it only for temporary situations.
  3. Minimize Redirect Chains: Each additional redirect reduces the transfer of PageRank.
  4. Redirect to the Most Relevant Page: Ensure the new URL matches the user’s intent to maintain a positive user experience.

Tools for managing redirects

Redirect analysis and testing tools are essential for diagnosing redirect status codes, detecting redirect chains, and identifying 404 errors. 

Here are some valuable tools to consider:

  • Google Search Console
    • Checks for indexation errors, broken links, and redirects.
    • Shows which pages Google considers permanently moved.
    • Monitors and troubleshoots redirects after a site migration.
  • Screaming Frog (Free for up to 500 URLs)
    • Crawls your site to identify redirects, chains, and broken links.
    • Detects various redirect types, including 301, 302, and 307.
    • Exports reports for deeper analysis.
  • HTTP Status & Redirect Checker
    • Checks the HTTP status code of any URL (301, 302, 404, etc.).
    • Identifies redirect chains and loops.
    • A quick and easy online tool for instant results.
  • Ahrefs Site Audit
    • Scans your site to detect redirect errors, chains, and broken links.
    • Identifies lost PageRank caused by incorrect redirects.
    • Essential for SEO audits and troubleshooting.

Are you, perhaps, ready to establish your online presence? Register your domain with SpaceLama today!

Our user-friendly platform makes it easy to search for and secure the perfect domain name for your business or personal brand. With a wide range of options and affordable prices, you can find exactly what you need in just a few simple steps.

Don’t miss out on the opportunity to create your unique online identity. Get started now and take the first step toward building your website with SpaceLama!