Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

AEM 6.5 | Dispatcher Rewrite Rule

Avatar

Level 2

I have the below requirement:

 

Suppose when the end user enters http://abc-123.co.in , the rewrite rule should be set in such a way that the URL is internally expanded to its home page full URL say http://abc-123.co.in/en/home.html but the full URL should not be visible on the address bar to the end user but rather be seen as http://abc-123.co.in (with .html extension and repo structure upto 'home' removed). How do we set up a rewrite rule for this?

 

Similarily, when the end user clicks on say, http://abc-123.co.in/en/home/about-us.html from the home page, again the full URL should not be visible to the end user but rather be seen as http://abc-123.co.in/about-us (with .html extension and repo structure upto 'home' removed). How do we set up a rewrite rule for this? 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

1. add entry in resource mappings at OSGI config in AEM 

/config.publish/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl.xml

resource.resolver.mapping="[/:/,/content/myproj/en/home:/]"

 

2. Add Apache server rewrite rules

RewriteRule ^/$ /content/myproj/en/home.html [PT,NE,L]

RewriteRule ^/(.*)$ /content/myproj/en/home/$1 [PT,NE]



Arun Patidar

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

1. add entry in resource mappings at OSGI config in AEM 

/config.publish/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl.xml

resource.resolver.mapping="[/:/,/content/myproj/en/home:/]"

 

2. Add Apache server rewrite rules

RewriteRule ^/$ /content/myproj/en/home.html [PT,NE,L]

RewriteRule ^/(.*)$ /content/myproj/en/home/$1 [PT,NE]



Arun Patidar