2012-01-25 02:50:42 +00:00
|
|
|
<%@page contentType="text/plain"%>
|
2004-07-24 02:06:07 +00:00
|
|
|
<%@page pageEncoding="UTF-8"%>
|
2006-02-15 05:33:17 +00:00
|
|
|
<%
|
2012-02-20 14:32:48 +00:00
|
|
|
//
|
|
|
|
// Redirect to either /home or /console, depending on configuration,
|
|
|
|
// while preserving any query parameters
|
|
|
|
//
|
2012-01-25 02:50:42 +00:00
|
|
|
response.setStatus(302, "Moved");
|
2012-02-20 14:32:48 +00:00
|
|
|
String req = request.getRequestURL().toString();
|
|
|
|
StringBuilder buf = new StringBuilder(128);
|
2012-01-25 02:50:42 +00:00
|
|
|
if (req.endsWith("index"))
|
|
|
|
req = req.substring(0, req.length() - 5);
|
|
|
|
else if (req.endsWith("index.jsp"))
|
|
|
|
req = req.substring(0, req.length() - 9);
|
2012-02-20 14:32:48 +00:00
|
|
|
buf.append(req);
|
2012-01-25 02:50:42 +00:00
|
|
|
if (!req.endsWith("/"))
|
2012-02-20 14:32:48 +00:00
|
|
|
buf.append('/');
|
2012-01-25 02:50:42 +00:00
|
|
|
boolean oldHome = net.i2p.I2PAppContext.getGlobalContext().getBooleanProperty("routerconsole.oldHomePage");
|
|
|
|
if (oldHome)
|
2012-02-20 14:32:48 +00:00
|
|
|
buf.append("console");
|
2012-01-25 02:50:42 +00:00
|
|
|
else
|
2012-02-20 14:32:48 +00:00
|
|
|
buf.append("home");
|
|
|
|
String query = request.getQueryString();
|
|
|
|
if (query != null)
|
|
|
|
buf.append('?').append(query);
|
|
|
|
response.setHeader("Location", buf.toString());
|
2006-02-15 05:33:17 +00:00
|
|
|
%>
|