How to change URLs in mega menu navigation | Community
Skip to main content
March 11, 2020
Solved

How to change URLs in mega menu navigation

  • March 11, 2020
  • 1 reply
  • 1392 views

Hi, 

I need to remove a redundant folder in URLs in mega menu. For example:

I have a page called MyPage in top Nav with URL www.example.com/mypage

under this pages I have the following URLs appearing in the drop down:

Page A     www.example.com/mypage/page-A

Page B     www.example.com/mypage/page-B

 

I would like to remove the "mypage" folder in the URLs in the mega menu drop down, example:

MyPage in top Nav: www.example.com/mypage

to show the following dropdown URLs

Page A     www.example.com/page-A

Page B     www.example.com/page-B

Essentially the URLs for "Page A" and "Page B" showing in the mega menu under "MyPage" will be at the same folder level. 

 

Please if you someone could let me know the best approach to do this in AEM it would be greatly appreciated.

 

Thank you

B

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

you can remove this page /content/mypage from org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl config

resource.resolver.mapping="[/:/,/content/mypage:/]"

 

you need to write rewrite as well to remap this again at apache rewriter

RewriteRule ^/(.*)$ /content/mypage/$1 [PT,NE]

 

Another way is write link rewrite and sling mapping

https://helpx.adobe.com/experience-manager/using/aem63_link_rewriter.html

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
March 11, 2020

you can remove this page /content/mypage from org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl config

resource.resolver.mapping="[/:/,/content/mypage:/]"

 

you need to write rewrite as well to remap this again at apache rewriter

RewriteRule ^/(.*)$ /content/mypage/$1 [PT,NE]

 

Another way is write link rewrite and sling mapping

https://helpx.adobe.com/experience-manager/using/aem63_link_rewriter.html

Arun Patidar