Also you can hack jetty or similar...

        // Force 302 redirect status code into 301 'permanent redirect'
        Field statusField = HttpGenerator.class.getDeclaredField("__status");
        statusField.setAccessible(true);
        Object[] statusMap = (Object[]) statusField.get(HttpStatus.class);
        statusMap[HttpStatus.MOVED_TEMPORARILY_302] =
statusMap[HttpStatus.MOVED_PERMANENTLY_301];


2012/5/14 Jeffrey Schneller <[email protected]>:
> Are you using Apache HTTPD in front of your app server?  If so, you can just 
> use a Rewrite Rule to send the 301 redirect with the new URL.  You may want 
> to look into your app server to see if url rewriting is an option.
>
>
>
> -----Original Message-----
> From: jarnis [mailto:[email protected]]
> Sent: Monday, May 14, 2012 5:56 AM
> To: [email protected]
> Subject: Redirect to Wicket page with 301 Moved Permanently
>
> Hey guys
>
> I'm trying to make a redirect form an old url to a new one. The browser url 
> should be changed to the new one and the response code for the original 
> request to the old url should be 301 Moved permanently so search engines will 
> forget the old url.
>
> Making the redirect by throwing a RestartResponseException works fine, except 
> I can't change the response code from 302 Moved Temporarily to 301 Moved 
> Permanetly
>
> I've also tried using the RedirectToUrlException, where setting the response 
> code is easy, but I have problems getting it to construct a correct relative 
> url so I don't have to hard code it to a specific host name.
>
> What is the best way to solve this?
>
> Thanks in advance
>
> Jarnis
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Redirect-to-Wicket-page-with-301-Moved-Permanently-tp4631888.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to