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

AEM resource mapping precedence over vanity url

Avatar

Avatar
Level 1
abhilashs827015
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
abhilashs827015
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile
abhilashs827015
Level 1

14-10-2020

Hi,

 

We are facing issue with /welcome.html in dispatcher!

 

/welcome is by default mapped to AEM welcome page i.e. /libs/cq/core/content/welcome.html

 

/welcome is also mapped (AEM resource mapping)to our project page i.e /content/abc/welcome.html

 Actual scenario : abc.com/welcome.html is redirecting to /libs/cq/core/content/welcome.html and throwing 404 as it is denied

Expected scenario : abc.com/welcome.html should internally redirect to /content/abc/welcome.html

So, first precedence is always given for AEM welcome page.

 

Is there any solution for this ?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 3
Level 3
SameerBhalerao
Level 3

Likes

25 likes

Total Posts

24 posts

Correct Reply

13 solutions
Top badges earned
Give Back 3
Give Back
Boost 5
Boost 3
Boost 25
View profile

Avatar
Give Back 3
Level 3
SameerBhalerao
Level 3

Likes

25 likes

Total Posts

24 posts

Correct Reply

13 solutions
Top badges earned
Give Back 3
Give Back
Boost 5
Boost 3
Boost 25
View profile
SameerBhalerao
Level 3

14-10-2020

Hi abhilashs827015,

 

Please try out /etc/map mapping for this scenario. It allows for domain mapping so you can put entries which allow you to map exact domain. One more advantage is that /etc/map respects runmodes so you can pretty much create this for any environment.

 

Please refer https://sling.apache.org/documentation/the-sling-engine/mappings-for-resource-resolution.html and http://blog.magmalabs.io/2016/07/26/how-to-use-internal-redirects-in-aem.html

 

An entry like below would work;

Capture1.JPG

 

Answers (1)

Answers (1)

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,081 likes

Total Posts

3,121 posts

Correct Reply

1,061 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,081 likes

Total Posts

3,121 posts

Correct Reply

1,061 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

14-10-2020

Your prblem is that you want to reuse an already existing vanity URL. Vanity URLs can exist only once per server, it cannot point to both locations. Personally I wouldn't use it, but rather the map the resource path to a proper URI using resource mapping. That's much more convenient and scales much better (assume that you want to have "nice" URLs also for other pages). Others in this thread have already pointed out URLs where you can read how you can achieve that.

 

HTH,
Jörg