commit ecff559465fdfca6aedb736dcc653ff1a8583273 Author: Karsten Loesing karsten.loesing@gmx.net Date: Fri Oct 7 11:24:13 2016 +0200
Remove 301 redirects, update error page.
These redirects have been in place for 9 months which should be plenty of time for users/bots to notice. --- website/etc/web.xml | 23 -------- .../torproject/metrics/web/RedirectServlet.java | 68 ---------------------- website/web/WEB-INF/error.jsp | 15 +---- 3 files changed, 2 insertions(+), 104 deletions(-)
diff --git a/website/etc/web.xml b/website/etc/web.xml index ebffdfb..97400b7 100644 --- a/website/etc/web.xml +++ b/website/etc/web.xml @@ -209,29 +209,6 @@ <url-pattern>/about.html</url-pattern> </servlet-mapping>
- <servlet> - <servlet-name>RedirectServlet</servlet-name> - <servlet-class> - org.torproject.metrics.web.RedirectServlet - </servlet-class> - </servlet> - <servlet-mapping> - <servlet-name>RedirectServlet</servlet-name> - <url-pattern>/consensus-health.html</url-pattern> - <url-pattern>/data.html</url-pattern> - <url-pattern>/exonerator.html</url-pattern> - <url-pattern>/formats.html</url-pattern> - <url-pattern>/graphs.html</url-pattern> - <url-pattern>/network.html</url-pattern> - <url-pattern>/papers.html</url-pattern> - <url-pattern>/performance.html</url-pattern> - <url-pattern>/relay-search.html</url-pattern> - <url-pattern>/research.html</url-pattern> - <url-pattern>/stats.html</url-pattern> - <url-pattern>/tools.html</url-pattern> - <url-pattern>/users.html</url-pattern> - </servlet-mapping> - <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> diff --git a/website/src/org/torproject/metrics/web/RedirectServlet.java b/website/src/org/torproject/metrics/web/RedirectServlet.java deleted file mode 100644 index c0a29cc..0000000 --- a/website/src/org/torproject/metrics/web/RedirectServlet.java +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright 2016 The Tor Project - * See LICENSE for licensing information */ - -package org.torproject.metrics.web; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@SuppressWarnings("serial") -public class RedirectServlet extends HttpServlet { - - /* Available permanent internal and external redirects. */ - private Map<String, String> redirects = new HashMap<String, String>(); - - @Override - public void init() throws ServletException { - - /* Internal redirects: */ - this.redirects.put("/metrics/graphs.html", - "/?type=gr&level=bs&level=ad"); - this.redirects.put("/metrics/network.html", - "/?tag=rl&tag=br&level=bs&level=ad"); - this.redirects.put("/metrics/performance.html", - "/?tag=pf&level=bs&level=ad"); - this.redirects.put("/metrics/stats.html", - "/?type=dt&level=bs&level=ad"); - this.redirects.put("/metrics/users.html", - "/?tag=cl&level=bs&level=ad"); - - /* External redirects: */ - this.redirects.put("/metrics/consensus-health.html", - "https://consensus-health.torproject.org/"); - this.redirects.put("/metrics/data.html", - "https://collector.torproject.org/"); - this.redirects.put("/metrics/exonerator.html", - "https://exonerator.torproject.org/"); - this.redirects.put("/metrics/formats.html", - "https://collector.torproject.org/#data-formats"); - this.redirects.put("/metrics/papers.html", - "https://research.torproject.org/techreports.html"); - this.redirects.put("/metrics/relay-search.html", - "https://atlas.torproject.org/"); - this.redirects.put("/metrics/research.html", - "https://research.torproject.org/"); - this.redirects.put("/metrics/tools.html", - "https://collector.torproject.org/#related-work"); - } - - @Override - public void doGet(HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { - String redirect = this.redirects.get(request.getRequestURI()); - if (redirect == null) { - response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); - return; - } else { - response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY); - response.setHeader("Location", redirect); - } - } -} - diff --git a/website/web/WEB-INF/error.jsp b/website/web/WEB-INF/error.jsp index 3aedc8d..8081f49 100644 --- a/website/web/WEB-INF/error.jsp +++ b/website/web/WEB-INF/error.jsp @@ -36,21 +36,10 @@ Unknown Error </b> when processing your request!</p>
-<p> -Maybe you find what you're looking for on our sitemap: -<ul> -<li><a href="index.html">Home</a></li> -<li><a href="network.html">Servers</a></li> -<li><a href="bandwidth.html">Bandwidth</a></li> -<li><a href="bubbles.html">Diversity</a></li> -<li><a href="users.html">Users</a></li> -<li><a href="performance.html">Performance</a></li> -<li><a href="about.html">About</a></li> -</ul> -</p> +<p>Maybe start over from the <a href="/">home page</a>.</p>
<p>If this problem persists, please -<a href="mailto:tor-assistants@torproject.org">let us know</a>!</p> +<a href="https://www.torproject.org/about/contact">let us know</a>!</p>
</div> </div>
tor-commits@lists.torproject.org