The idea for the Shopware Redirect Plugin
With the Shopware Redirect Plugin, we at scope01 want to make your work easier and help you. Because again and again we as Internet agency are faced with the tedious challenge that we have to manually manage redirects (redirects) for customers, for example, during a launch or when changing / deactivating products in the htaccess.
This is neither comprehensible for the customer nor administratable during operation. Because usually no customer works on a htaccess file. Also, the coordination of sending Excel / CSV data is quite cumbersome and time-consuming. So we came up with the idea for Shopware to develop a plugin in which users can manage redirects in the Shopware backend. First we developed the plugin for Shopware 5, then also for Shopware 6.
What are redirects?
2 types of redirects are very important for the administration of online stores:
- The status code 301 stands for a permanent redirection (moved permanently). This is used, for example, when an item is sold out and a successor is already defined. This successor should then be linked automatically.
- The status code 302 stands for a temporary redirection (moved temporarily). For example, an article has no more stock and should be taken offline for a certain time. So you can temporarily redirect to an alternative product in the store.
Through the entry of redirects, errors (eg error 404 not found) for the visitor of the online store are avoided. In addition, the value of a search engine optimized page is transferred from the old to the new article.
Since 2020 we offer our successful Shopware Redirect Plugin for Shopware version 6. This has been fundamentally redeveloped by us, since the technical basis has changed completely from Shopware version 5 to version 6. This means that the options for setting up redirects are also available in the new version of the e-commerce software. Both for permanent (301) and temporary redirects (302). You can download this plugin here in the Shopware Store.
The administration of redirects is located in Shopware 6 under Settings – Shop – Redirects:
Administration im Shopware Redirect Plugin
To manage the redirects, the start address (Start URL), the target address (Target URL) and the associated http code are entered in both plugins (Shopware 5 and 6). The status codes 301 and 302 are available for selection. Regarding the addresses (URL) the user can add a new entry in the administration. As well as all already deposited entries delete or edit.
In addition to the manual editing of redirects, there is the possibility of already deposited redirects for Shopware to export or import new redirects. For this purpose, two prominent buttons are available to the user. The export of the files takes place in the form of a csv file with UFT-8 coding. For the import of data, these specifications must be taken into account (CSV/UTF8), otherwise no import is possible.
Frequently asked questions (FAQ) (Shopware 6)
Questions about the function of the plugin
In order to use our plugin, the old URLs must still be accessible. Since this is usually not the case, configuring the redirects using a single .htaccess command is more suitable. Otherwise, you also have to store each individual URL with source and destination in our redirect plugin to achieve the desired behavior.
Yes. It does not matter whether the different sales channels run with different domains or with the same domain.
Yes. Since version 1.2.0 it is possible to ignore QUERY strings in the source URL. This can be enabled/disabled individually for each redirect. Since version 2.1.0 it is also possible to transfer query strings from the called URL to the target URL.
Yes. Since version 2.2.0 special chars like umlauts are supported in the source URL. This support must be enabled in the plugin configuration.
With the Shopware Redirect Plugin, only redirects with the source URL located in the Shopware environment can be realized. The target URLs can be freely chosen and do not have to be in the Shopware environment.
The Redirect plugin complements the Shopware logics regarding redirects.
The redirects set by Shopware are not listed in the redirect plugin.
No. If no sales channel is selected, the redirect is available in all sales channels.
Questions about the operation of the plugin
In Shopware 6 under Settings – Shop – Redirects.
It is best to create redirects once in the plugin and then export them. Please use this file as a template. Because often there are problems with the encoding (character set), the column names, possible spaces, etc. when importing. A semicolon (;) must be used as separator.
Generally, it can happen during import that a redirect in the import file already exists in the system. For this case, you can specify whether the system should overwrite the existing redirect in the system with the redirect from the file, or whether the redirect in the file should be skipped.
There are 2 ways to detect identical redirects – for both ways you can choose separately between overwrite and skip:
- The IDs of the redirects are the same
- The source URLs of the redirects are the same
You can choose for each redirect individually how to handle query parameters. The following options are available:
- “Consider Query Parameters during search”: When searching for a suitable redirect, the called URL inclusive query parameters is searched for.
Example: If a redirect from “/demo” to “/target” was created, but the customer calls “/demo?aParameter”, the request will not be redirected.
- “Ignore Query Parameters during search”: When searching for a suitable redirect, the called URL with and without query parameters is searched for.
Example: If a redirect from “/demo” to “/target” was created and the customer calls “/demo?aParameter”, the request will be redirected to “/target”.
- “Ignore Query Parameters during search and add them to the target URL”: When searching for a suitable redirect, the called URL with and without query parameters is searched for. Then the called query parameters are appended to the configured target URL.
Example: If a redirect from “/demo” to “/target” was created and the customer calls “/demo?aParameter”, the request will be redirected to “/target?aParameter”.
In order for a new redirect to be created, the filed “id” column must simply be left blank. However, the column must not be omitted.
The table is called scop_platform_redirecter_redirect.
Yes, the source code is available on Github: https://github.com/scope01-GmbH/ScopPlatformRedirecter
Major Updates Shopware Redirect Plugin
We have been offering the Shopware Redirect plugin in the Shopware Store and on Github for 4 months. In the Store alone, it has already been downloaded over 100 times. On Github, too, the first activity is already showing. So the demand for an easy administration of redirects, directly in the Shopware backend, is there.
For this reason we decided to refactor the Shopware Redirect Plugin with version 1.0.6. In other words, we have once again fundamentally improved and optimized the code.