Expand my Community achievements bar.

Issues with 301 Redirect

Avatar

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

Avatar

Employee 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")) {