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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

AEM 6.5 | Dispatcher Rewrite Rule

abn93
Level 2
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
Arun_Patidar
Correct answer by
Community Advisor
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]

View solution in original post

1 Reply
Arun_Patidar
Correct answer by
Community Advisor
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]

View solution in original post