Redirects
Redirects serve as a tool or rules which guide users to an alternate URL in lieu of the one initially requested. For instance, if a user attempts to access ‘https://javadoubts.com/aem-overview/‘, they will be seamlessly led to ‘https://javadoubts.com/aem/‘ instead. It’s important to note that redirects are applicable for both internal and external domains or URLs.
While it is possible to set up redirect rules as part of our Content Delivery Network (CDN) configurations. But, Edge Delivery services also offer the inherent functionality to establish these rules.
To implement redirects, follow these steps:
Begin by creating a Google Sheet titled redirects in the root folder as shown below:
redirects Google sheet created in root folder as shown below:
Next, rename the newly created Google Sheet as redirects. Within this sheet, construct two columns, designated as Source and Destination. Populate these columns with appropriate values that represent the original and the intended URLs respectively. To visualize this process, consider the example in the screenshot below. In this instance, when a user attempts to access the /contact page, they are promptly redirected to the /contactus page. This exemplifies the practical use of setting up redirects.
Click on Preview button to make it available to end users or picked up by code.
When a user attempts to access the /contact page, they are promptly redirected to the /contactus page as shown below:
Imran Khan, Adobe Community Advisor, AEM certified developer and Java Geek, is an experienced AEM developer with over 11 years of expertise in designing and implementing robust web applications. He leverages Adobe Experience Manager, Analytics, and Target to create dynamic digital experiences. Imran possesses extensive expertise in J2EE, Sightly, Struts 2.0, Spring, Hibernate, JPA, React, HTML, jQuery, and JavaScript.