AEM 6.3内部重定向配置报错求助:/aem请求无法正常跳转
/aem (No .html Suffix) It looks like your current Sling Mapping setup only handles requests with the .html suffix because of how AEM's resource resolution works by default. When you hit /aem without the suffix, AEM tries to locate a resource named aem in the repository first—which doesn't exist—hence the internal server error. Here are two reliable solutions to fix this:
Solution 1: Adjust Sling Mapping Configuration
Update your existing mapping to properly handle the non-suffixed /aem request, and ensure the mapping takes priority over resource resolution:
Navigate to
/etc/map/http/in CRXDE Lite (localhost:4502/crx/de).Select your existing mapping node (or create a new one named
aem_login_redirect).Update/add these properties:
jcr:primaryType:sling:Mapping(keep this as-is)sling:match:localhost.4502/aem(this matches the exact non-suffixed path)sling:internalRedirect:/content/myapp/en/login.html(keep your target path)- Add a new property:
sling:redirectStatuswith typeLongand value302(this ensures a proper client-side redirect; skip if you strictly need server-side internal forwarding, but 302 works reliably for most use cases) - Optional: If you want to handle any subpaths under
/aem(e.g.,/aem/foo), use a regex match:sling:match = localhost.4502/aem(/.*)?
Save the changes and clear the AEM cache (via
/system/console/cacheor restart the instance if needed).
Solution 2: Use Vanity Path (Simpler for Page Redirects)
Vanity paths are designed exactly for this scenario—mapping a clean URL to a content page without relying on Sling Mappings:
- Navigate to your login page node in CRXDE Lite:
/content/myapp/en/login - Add a new property to this node:
- Name:
vanityPath - Type:
String - Value:
/aem
- Name:
- Optional: If you want to redirect instead of serving the page directly, add
vanityRedirectwith typeBooleanand valuetrue(this sends a 302 redirect to the actual page URL). - Save the changes and activate the page (if working on the author instance and need it on publish).
After setting up either solution, accessing localhost:4502/aem should redirect to your login page without needing the .html suffix.
内容的提问来源于stack exchange,提问作者Diego Nieto

