Jahia in English > How to make a 301...

0 (0 Good)
0 (0 Bad)

How to make a 301 direction in a Jahia template

by  max »  2018/03/20 17:29

Hello,

I can't manage to do a permanent redirection (301) in jahia.

I tried to use a piece of code I've seen in many places in my jsp :

<%
response.setStatus(301);
response.setHeader( “Location”, “http://www.new-url.com/” );
response.setHeader( “Connection”, “close” );
%>

 

Using the meta refresh method works nicely to make a redirection 302 (moved temporaly), but i would prefer to have a 301.

Has anyone managed to make the 301 redirection work from a jsp template in Jahia ?

max
Number of messages  1
Not registered
1 (1 Good)
0 (0 Bad)

Re: How to make a 301 direction in a Jahia template

by  pvollenweider »  2018/03/27 08:54

Hello,

You can't do it from a JSP; it's too late in the processing. You should do a filter to handle such redirection, or, if it's only a one-shot, you can do it very quickly threw an Apache RewriteRule instruction.

Cheers,

Philippe.

Philippe Vollenweider (pvollenweider)

Number of messages  11
Registration date
Contact
Share
Feedback

Get in touch

Whether you are a current user or if you are just evaluating Jahia, we are here to help.

Contact us

Share this page