You need to sign in to do that
Don't have an account?
Dovid B
URL redirect with GET parameters
Normally speaking in order to do a 301 redirect from a URL with parameters, you need to modify .htaccess with a rewriteCond as seen here for example.
Since, as far as I have seen, we don't have access to .htaccess in Sites. Anybody come up with a good way to redirect a URL with parameters? Preferably a way to transfer those parameters to the new URL.
Thanks.
You can redirect from a Visualforce sites page using a page action method - this specifies a method on your controller that is invoked prior to rendering the page, allowing you to redirect the user.
You can add parameters to the URL via PageReference.getParameters().
Here's a noddy example -
Page:
Controller
Make sure you use the setRedirect(true) mechanism, or the redirect doesn't take place (at least that's what I've found today).