You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AEM 6.3内部重定向配置报错求助:/aem请求无法正常跳转

Fixing AEM 6.3 Internal Redirect for /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:

  1. Navigate to /etc/map/http/ in CRXDE Lite (localhost:4502/crx/de).

  2. Select your existing mapping node (or create a new one named aem_login_redirect).

  3. 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:redirectStatus with type Long and value 302 (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(/.*)?
  4. Save the changes and clear the AEM cache (via /system/console/cache or 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:

  1. Navigate to your login page node in CRXDE Lite: /content/myapp/en/login
  2. Add a new property to this node:
    • Name: vanityPath
    • Type: String
    • Value: /aem
  3. Optional: If you want to redirect instead of serving the page directly, add vanityRedirect with type Boolean and value true (this sends a 302 redirect to the actual page URL).
  4. 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 04:12:56