Handling Redirections

| 7 minutes

It is important to understand that if any URL on the website is changed, it needs to be redirected. Redirection means that when a user opens the old URL, they will be instantly taken to the new one.

Each old URL must be redirected for 2 main reasons:

  1. SEO: Search engines index every page on the website, recording the page URL in their databases. When a page's URL changes, the old URL might still be displayed in search results for some time because search engine databases aren't updated immediately. If an old URL no longer exists, search engines will display it until they detect a 404 error(page not found). Pages that return 404 errors are removed from search results, and the website can be penalized, potentially losing valuable rankings. This also results in a loss of all SEO value that the page had acquired. To avoid this, implementing a 301 redirect transfers the SEO equity of the old page to the new URL, preserving the page's search engine performance.

  2. UX: If an old URL is not redirected, users will encounter a 404 error when trying to access the page through search results or external links (e.g., backlinks still pointing to the old URL). This results in a poor user experience, as users will be unable to access the content they expect. This can lead to frustration and increased bounce rates (users leaving the site immediately), which negatively impacts the overall user experience and can indirectly affect SEO.

There are 2 ways to set redirections for the old URLs:

  • Adding the URL redirects to the plugin one by one
  • Uploading multiple URLs to the plugin at once via CSV file

Below is the detailed process of updating the URL redirects for each of these ways.

Redirection Rules

There are rules that must be taken into account before updating the redirects on the website. The list of new redirects needs to be checked and updated taking into account already existing redirects according to the rules below.

  1. No circle redirects/no redirect loops

    A redirect loop/circle redirect occurs when a URL repeatedly redirects to another URL (or back to itself) in such a way that the browser is stuck in an infinite cycle of redirections without ever reaching the intended page. This happens when the redirect chain is misconfigured, causing the browser to keep following redirects indefinitely. This situation can happen when the old website URL was the same as the URL the Content Editor wants to change the current URL to.

    Example:

    • /fr/produits-pharmaceutiques/clobetasol-propionate-creme →/fr/medicaments/creme-de-propionate-de-clobetasol
    • /fr/medicaments/creme-de-propionate-de-clobetasol →/fr/medicaments/clobetasol-propionate-creme

    The above case creates a redirect loop. This kind of loop is not acceptable, it creates an infinite redirect and the user won't be able to get to any page getting an error “ERR_TOO_MANY_REDIRECTS”. This will also cause a negative SEO impact and the website will be penalized. In the above case the first redirect needs to be removed, leaving only the following redirect:

    • /fr/medicaments/creme-de-propionate-de-clobetasol → /fr/medicaments/clobetasol-propionate-creme
  2. No duplicated/double redirects

    As there are a lot of already existing redirects, before adding any new redirects Content Editor must make sure that there are no existing redirects that point to the old URL that needs to be redirected. This case will happen frequently, as the current list of redirects includes the URLs from the old website, which were redirected to the current URLs of the new website. Therefore, if any current page URL is changed, it is likely that the old website URL was previously redirected to it.

    Example:

    • /fr/produits-pharmaceutiques/clobetasol-propionate-creme →/fr/medicaments/creme-propionate-clobetasol
    • /fr/medicaments/creme-de-propionate-de-clobetasol →/fr/medicaments/creme-propionate-clobetasol

    The above case makes a double redirect. The redirects should be revised to the following:

    • /fr/produits-pharmaceutiques/clobetasol-propionate-creme →/fr/medicaments/creme-propionate-clobetasol
    • /fr/medicaments/creme-de-propionate-de-clobetasol →/fr/medicaments/creme-propionate-clobetasol
  3. That way, the old website URL and the previous URL of the product are both redirected to the new URL separately, without a double redirect.

  4. Format

    Make sure that each redirect follows the correct format:

    • No domain
    • Always start with “/”
    • Include the language (unless the old URL does not contain the language)
    • Do not use uppercase, unless it is specifically required. If there is a need to redirect a URL with uppercase (for example for marketing promotional needs), URLs with uppercase letters must be redirected separately.

    List of redirects currently published:

    Production: https://admin.advacarepharma.org/wp-json/custom/v1/export-redirects

    Dev: https://admin.dev.4.advacarepharma.org/wp-json/custom/v1/export-redirects

Adding the URL redirects to the plugin one by one

This method of updating the URL redirects is used when only a few URLs need to be redirected. This method will be applicable for most of the situations, when just several product names have been changed and URLs need to be revised.


The list of the changed URLs should have been prepared in advance by the Content Editors when changes in the content were made. In addition, as mentioned in the “Importing the Content to the Website” section, point 7, the script will print the list of the needed redirects at the end of the process, before deployment starts.


The process of creating the redirects in the plugin one by one is the following:

  1. Open the list of required redirects, or copy from the Builder log.
  2. Open “Redirections” plugin in WP: Tools -> Redirections
  3. Check the existing redirects to make sure that none of the new redirects will duplicate or loop the already existing redirects:
    3.1 Search every old URL that needs to be redirected in the existing list of redirects, and identify if the destination of the old redirect needs to be changed to the new URL
    3.2 Search every new URL in the existing list of redirects to make sure that there are no redirect loops, and identify if any of the old redirects need to be removed.
    3.3 Make sure the format of every redirect in the new list is correct.
  4. Click “Add New” to create a new redirection.
  5. Fill out the information required to create a new redirect:
  6. - Source URL:enter the old URL that needs to be redirected, without the domain (for example, /en/supplements-manufacturer)
    - Target URL: enter the destination URL, the URL where the old URL needs to be redirected to (without the domain as well, for example /en/supplements)
    - Group: Select the group from the dropdown. For manually added URLs select the group “Redirections”.

  7. Once all the above information is filled out, check the entries and make sure everything is correct.

    Note: every URL MUST be correct. Mistakes in the URLs are not acceptable and will cause serious issues to the website.

  8. Click “Add Redirect” to save the changes.
  9. Check the added redirect in the plugin and move forward to repeat the steps to add the rest of required redirects.
  10. Once all the redirects are added and checked and are 100% correct, Content Editor must trigger the update in the live website. The deployment will not happen by itself, the update must be triggered manually. To trigger the deployment, unless some actual change is required, Content Editor can go to any website page in WP and click “Update”.
  11. Once the changes are published, check the redirects by entering the old URLs to make sure that every one of them works correctly.
  12. Inform Marketing Dept. Manager via task that required redirects have been set.

Uploading multiple URLs to the plugin at once via CSV file

At the moment of writing this SOP the process of importing a CSV file to Redirections plugin has not been tested for special cases and scenarios.


The overall process is to create a clean CSV file with desired redirects following the format required by the plugin:

The file prepared for the import must be saved in the following folder in the file server: Z:\Shared drives\Website Projects\AC - advacarepharma.com\Version 4 (2022)\Design Phase\3.SEO\Redirections\Redirections Import


The file name must be clean and contain the date of the creation.

Once the file is prepared, the Content Editor must inform the Marketing Dept. Manager to check the file, make sure the format is correct and run the import for the first time. The new redirects must be imported to dev before production, and checked in dev to make sure everything works as expected. Marketing Dept. Manager can request assistance from the IT Dept. Manager or Development Team if required.


Scenarios to be tested:
  • Import of the redirects list without prior clean up of the double redirects and redirects loops. The program in the back is expected to clean up the list before uploading to the final destination in the server, however, in this case Redirections plugin will not have full synchronization with the actual redirects in the server.
    CAUTION: the above has never been tested and is only expected behavior which might not work, it must be tested in dev first. It is also not advised to use this approach unless necessary as it will cause differences in redirect lists between the plugin and the server.
Did this article help you?
 0
 0