How to 301 redirect in Apex?
Hi,
has anybody experience in how to send a 301 redirect in Apex?
Google has indexed some URLs to our product page for products which are not in stock any more. Therefore I created a page process which redirects to a proper valid URL if the requested product is not in stock anymore.
Problem is, any redirect I manage to do in Apex is a 302 redirect. But the proper action in such a case would be, to send a 301 (permanently moved) redirect.
While researching I stumbled accross a trick in Tyler Muth´s blog
http://tylermuth.wordpress.com/2008/05/11/speech-to-text-to-apex
which adds an additional status line in the response:
owa_util.status_line(301, null,FALSE);
owa_util.redirect_url('/new-url', TRUE);
In my environment (XE, Apex 3.2.1) this approach still sends a 302 redirect.
I´d be glad for some insight from anyone
Thanks
Jens