etc.map for assets causing problems.

Avatar

Avatar
Boost 1
Level 2
AEMWizard
Level 2

Like

1 like

Total Posts

30 posts

Correct reply

1 solution
Top badges earned
Boost 1
Validate 10
Validate 1
Applaud 5
Affirm 1
View profile

Avatar
Boost 1
Level 2
AEMWizard
Level 2

Like

1 like

Total Posts

30 posts

Correct reply

1 solution
Top badges earned
Boost 1
Validate 10
Validate 1
Applaud 5
Affirm 1
View profile
AEMWizard
Level 2

07-01-2021

I am putting together an example with the AEM 6.5, we.retail, etc.mappings, with the configurations below. The HTML routing is working correctly and removal of .html extension also works, but or some reason all the images, /etc.clientlibs, JS & CSS, JSON files are all 404 not found after implementation. Is there something in etc.mappings where I can disable sling mappings for assets?

AEMWizard_0-1610056636816.png

Configuration:

 

 

{

    "jcr:primaryType": "sling:Folder",
    "weretail.com": {
        "jcr:primaryType": "sling:Mapping",
        "sling:internalRedirect": [
            "/content/we-retail/us/en"
        ],
        "weretail_com_content": {
            "jcr:primaryType": "sling:Mapping",
            "sling:match": "(.+)$",
            "sling:internalRedirect": [
                "/content/we-retail/us/en/$1",
                "/$1"
            ]
        },
        "reverse_mapping_content": {
            "jcr:primaryType": "sling:Mapping",
            "sling:match": "$1",
            "sling:internalRedirect": [
                "/content/we-retail/us/en/(.*).html"
            ]
        },
        "reverse_mapping_content_nohtml": {
            "jcr:primaryType": "sling:Mapping",
            "sling:match": "$1",
            "sling:internalRedirect": [
                "/content/we-retail/us/en/(.*)"
            ]
        },
        "reverse_mapping_root": {
            "jcr:primaryType": "sling:Mapping",
            "sling:match": "$",
            "sling:internalRedirect": [
                "/content/we-retail/us/en(.html)?"
            ]
        }
    },
    "weretail_com_root": {
        "jcr:primaryType": "sling:Mapping",
        "sling:match": "weretail.com$",
        "sling:internalRedirect": [
            "/content/we-retail/us/en.html"
        ]
    }
}

 

 

Thanks

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,462 likes

Total Posts

3,328 posts

Correct reply

949 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,462 likes

Total Posts

3,328 posts

Correct reply

949 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

08-01-2021

You may need to change the below rule

Below rule matches everything .html, js, css ... and mapping to /content/we-retailt......

"sling:match": "(.+)$",

you can restrict this only for html

 

"sling:match": "(.+).html$",
"sling:internalRedirect": [
      "/content/we-retail/us/en/$1.html",
      "/$1"
]

 

 

 

Answers (1)

Answers (1)

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,141 likes

Total Posts

3,167 posts

Correct reply

1,084 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,141 likes

Total Posts

3,167 posts

Correct reply

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

08-01-2021

You can use localhost:4502/system/console/jcrresolver to check the resolution of these URLS. Unfortunately I don't see from the screenshot what path these clientlib requests are using.