URL Redirects Module in Sitecore
In one of my projects, my client's requirement was to implement the URL Redirect feature from his existing SharePoint website to the New Sitecore website. My client suggested the "Constellation.Feature.Redirects" Redirect module to accomplish the functionality.
In this blog, I am giving insight on this module installation, what features I have used and the challenges I have faced during implementation. I want to give a huge thanks to Richard Cabral aka Sgt Sitecore who guide and helped me with the implementation.
Installation:
To install the URL redirect module please find below the link in which all the steps are mentioned in detail: Constellation.Feature.Redirects
Steps: Constellation.Feature.Redirects are managed via NuGet.
In Visual Studio, fire up the Package Manager console and install it into a Web Application project:
PM:> Install-Package Constellation.Feature.Redirects
After installation, you must build and deploy your solution. You must then immediately run your Sitecore install to make sure the attached Items get added to your databases.
I have installed below URL Redirect module with the new Sitecore 9.3 Instance. On successful installation, it shows the Redirect Manager in the Desktop icons.
I have added a few Redirect URLs as below:
And after that, I have performed the below functionality and it’s working fine:
-
New items: When you select the new icon button then it will open a
popup window for a new redirect item. Fill in all the details and select the
Ok button:
-
Edit Items: When you select any of the items and click on the edit
icon it will ask you for the confirmation message and show you a popup as
below:
-
Export: On selection of Export icon, it will ask you to export all
redirect items to CSV file. Select the Ok button and CSV file download will
start.
-
Import: Click on the Import icon, it will ask you to choose a file
and upload it. Once you will upload the CSV file in the same format which
you downloaded from the export option, it will import all the redirect URLs
in Sitecore.
-
Publish: To publish all the redirect URL’s go to the Sitecore content
tree and find items on the path:
/sitecore/system/Modules/Constellation
Publish all the items and it will index all redirects items.
-
Index: From the Sitecore Desktop icon select "Control Panel":
It will redirect you to the Control Panel section of the Sitecore instance. Click on the “Indexing Manager” under the "INDEXING" tab:
It will open an indexing manager popup for you and allow you to rebuild the indexes in Sitecore.
Select the Marketing Indexes of the Web Database and click the "Rebuild" button:
Once your index rebuilds success, you can check your redirect URL.
-
Redirects: Hit the Old URL into the browser and it will redirect to
the New URL.
Notes:
Below are points we need to take care of during the setup of the module:
-
All config files related to this module should exist at the
"~\App_Config\Include\Constellation"
path.
- Constellation.Feature.Redirects.config
- Constellation.Foundation.ModelMapper.config
- Constellation.Foundation.PackageVerification.config
-
URL redirect resolver pipeline should be executed before any Page Not Found
resolver’s pipeline.
Workaround:
- Xconnect marketing service should run.
- Rebuild marketing index
-
"Website.config" should have "target" hostname and "schemes" tag in Sites
tag.
-
Last but not least If you are using a bucket in your Sitecore Content Tree
then you need to update the below query code in the existing module:
Existing code: If your bucket in Sitecore Tree is with Time
In my case Bucketing was not with time and only with Year, month and date so I have update the existing code:
Reference: https://constellation4sitecore.com/feature/redirects/
Happy Sitecoreing 😊
Comments
Post a Comment