Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

Issues with 301 Redirect

v1101
Level 5
Level 5

I have followed the below article to implement the 301 redirect in AEM 6.5. RedirectType & Target options are available in Page properties for the authors to make the selection. Also created separate servlet with the same selector(redirect) with 301 redirect logic in it and also assigned the highest service ranking for this servlet.

The redirectType & Target values are getting stored in jcr:content of the page. The results of the Sling Servlet Resolver is also showing the expected results. For some reason, the 301 redirect is not happening. I have tried in author (wcmmode=disabled) as well as publish instance but it doesn't work.

 

Sample Attached:

v1101_0-1609386258335.png

 

http://www.sgaemsolutions.com/2018/12/implement-301-and-302-redirect-in-aem.html

 

Can someone advise on this?

1 Reply
shelly-goel
Community Advisor
Community Advisor

@v1101 

Is your oob 302 redirect working? If that is working, you might want to check the logs if there are any errors for the custom servlet and try putting a debugger in your servlet to see if redirectType is getting resolved at this line: if (redirectType.equals("301")) {