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

SOLVED

etc.map for assets causing problems.

AEMWizard
Level 3
Level 3

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

 

1 Accepted Solution
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

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"
]

 

 

 

View solution in original post

3 Replies
Jörg_Hoh
Employee
Employee

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.

Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

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"
]

 

 

 

View solution in original post

AEMWizard
Level 3
Level 3
This works, however, the we-retail project has images stored in /content/we-retail/*... had to put in custom configuration to resolve the issue.