我试图在AEM6.3中做一个内部重定向,我想做的是:任何到localhost:4502/aem的请求都应该重定向到localhost:4502/content/myapp/en/login.html.因此,我在/etc/map/http/下创建了一个吊带:映射节点
jcr:primaryType="sling:Mapping"
sling:internalRedirect=/content/myapp/en/login.html -> Type String
sling:match=localhost.4502/aem -> Type String 我收到了一个内部服务器错误:不能在此服务器上向/aem提供请求。但是,如果我添加了.html后缀(请求到),它就可以正常工作并重定向。
也曾尝试过:
sling:match=localhost.4502/aem(.*)(/.*)?我想知道我错过了什么/做错了什么。提前谢谢你的帮助。
发布于 2018-04-16 18:30:18
我使用sling:redirect而不是sling:internalRedirect,来解决它,不确定这是否是正确的解决方案,但正在工作:
jcr:primaryType="sling:Mapping"
sling:redirect=localhost:4502/content/myapp/en/login.html -> Type String
sling:match=localhost.4502/aem -> Type String 如果你有更好的选择,可以随意发布,谢谢。
发布于 2019-09-20 06:54:32
我建议你去http://localhost:4502/system/console/jcrresolver检查你的重定向是正确还是不正确!
例如,您的CRXDE 内部URL是http://localhost:4502/content/app1/en-in/home.html,而首选的外部URL是http://localhost:4502/home/
有一些选项你可以看到
map:当您输入内部URL时,map将返回外部URL。记住在末尾添加.html。
解决方案:解决方案与地图相反。在测试过程中,请记住在测试结束时添加.html。
https://stackoverflow.com/questions/49861325
复制相似问题