You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by mjkelleher <mj...@gmail.com> on 2010/06/09 17:43:02 UTC

Override sling vanity url handling

For vanityURL, sling issues a HttpServletRequest.sendRedirect, sending an
HTTP 302 back the the requesting browser.

In certain circumstances, our users want to issue a 301 instead.

I can see in the sling class:
org.apache.sling.jcr.resource.internal.helper.MapEntry has a value for
"sling:status" which is potentially the status code that is emitted upon a
redirect.

My question is: how do I leverage use of sling:status or override the
redirect functionality of sling?  I have not yet been able to specifically
pin down where the redirect is issued.

Thanks!
-- 
View this message in context: http://apache-sling.73963.n3.nabble.com/Override-sling-vanity-url-handling-tp882593p882593.html
Sent from the Sling - Users mailing list archive at Nabble.com.

Re: Override sling vanity url handling

Posted by mjkelleher <mj...@gmail.com>.
I am thinking I will handle this as a Filter, watching for a 302 response
within a site where our users want this kind of handling to occur.

A filter is more easily removable, but I am wondering if there is a more
elegant and natural way to handle this kind of scenario.
-- 
View this message in context: http://apache-sling.73963.n3.nabble.com/Override-sling-vanity-url-handling-tp882593p883124.html
Sent from the Sling - Users mailing list archive at Nabble.com.