Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] 301 redirect of index.html

Hi,

I've would like to make a permanent (301) redirect of
www.domain.com/index.html to www.domain.com. I've tried using
MovedContextHandler but I only get 302 redirect's even tho I set the
permanent flagg to true.

I've also tried using a servlet using catching the pattern "/index.html"

resp.setStatus(301);
resp.setHeader("location" , "http://www.domain.com/";);

but this will of course render i a infinite loop.

On a Apache server I would put something like this in a .htacces file
---
Options +FollowSymLinks
RewriteCond %{THE_REQUEST} ^.*/index.html
RewriteRule ^(.*)index.html$ http://www.domain.com/$1 [R=301,L]
---

My question is how can I solve this issue with jetty?

Kind regards
Kjell Tillstrand


Back to the top