1

Is there any easy way to configure permanent redirects (301) on openCMS? I would like to forward some of my old page urls to their new location.

Thanks

checklist
  • 12,340
  • 15
  • 58
  • 102

2 Answers2

0

I found UrlRewriteFilter (http://tuckey.org/urlrewrite/) to be quite nice to work with and solved my issue!

checklist
  • 12,340
  • 15
  • 58
  • 102
0

You can create a JSP-template which does nothing else than to send a 301 Permanent Redirect. I did that and it works.

Depending on your requirements you can put the new URL in a property or automatically modify the old URL in the JSP-template.

  • I tried to put it in JSP on OpenCms 7.5.2 but it does not work, nothing happens. <% response.setStatus(301); response.setHeader( "Location", "https://www.domain.com/newPage.html"); response.setHeader( "Connection", "close" ); %> – Mathias Conradt Jul 25 '15 at 09:33
  • Update: make sure you use the OpenCms specific methods for that: http://lists.opencms.org/pipermail/opencms-dev/2009q4/033082.html – Mathias Conradt Jul 25 '15 at 09:34