How to do sling:internalRedirect pointing an internal ws call | Community
Skip to main content
September 15, 2017

How to do sling:internalRedirect pointing an internal ws call

  • September 15, 2017
  • 2 replies
  • 6505 views

I like to reproduce the same action I have in Apache on etc/map

RewriteRule ^/sitemap.xml http://localhost:%{ENV:aemPort}/services/sitemap/map.xml [P]

the /services/sitemap/map is a service resource.

Right now I have it like this:

    jcr:primaryType="sling:Mapping"

    sling:internalRedirect="/services/sitemap/map.xml"

    sling:match="\[^/]+/map.xml"/>

But for some reason is not working is throwing me a 404, is like after he get the etc/map match he don't return to validate againg the servlets or service resource validation.

Also is it possible to have an internalRedirect pointing to an external domain?

something like this RewriteRule ^/page1$ http://www.external-site.com/page1.html [L,P]

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

smacdonald2008
Level 10
September 15, 2017

See these docs - i am not sure that you can make an external WS call however --

Apache Sling - Mappings for Resource Resolution

September 19, 2017

I used that link as references but not luck

    jcr:primaryType="sling:Mapping"

    sling:internalRedirect="/services/sitemap/map.xml"

    sling:match="\[^/]+/map.xml"/>

whats wrong here, I see it normal internal redirect just an exception that is going to a ws call (the ws is internal), if I use sling:redirect works but not intenal?

smacdonald2008
Level 10
September 19, 2017

I think redirect is for internal AEM resources. However - if someone has made an external redirect work - please update this thread.

ashwinrao38
January 25, 2018

try property: "sling:redirect" . this will send a new request with a modified location

Reference: How to configure Internal and External Redirects in CQ5 | aemblog