How to do sling:internalRedirect pointing an internal ws call | Community
Skip to main content
New Participant
Sep 15, 2017 2:05 PM UTC

How to do sling:internalRedirect pointing an internal ws call

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.

4 replies

ashwinrao38
New Participant
Jan 25, 2018 10:08 AM UTC

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

Translate
smacdonald2008
Level 10
Sep 15, 2017 4:34 PM UTC

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

Apache Sling - Mappings for Resource Resolution

Translate
New Participant
Sep 19, 2017 10:05 PM UTC

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?

Translate
smacdonald2008
Level 10
Sep 19, 2017 10:15 PM UTC

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

Translate