DPDK website maintenance
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: web@dpdk.org
Subject: [dpdk-web] [PATCH] use full URLs in error pages
Date: Tue, 24 May 2016 21:49:17 +0200	[thread overview]
Message-ID: <1464119357-10064-1-git-send-email-thomas.monjalon@6wind.com> (raw)

In order to serve 403 and 404 error pages outside of the web
domain, the resources (css/img) must be pointed with an absolute
full URL.
The navigation links are also absolute to provide access to good pages
when trying to access to a wrong sub-domain (e.g. error.dpdk.org).

The page 403 is new and copied from 404.

The full URL is stripped in the local server to be able to test these
pages with local resources.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 404.html => 403.html   | 27 ++++++++++++++-------------
 404.html               | 25 +++++++++++++------------
 layout.css             |  2 +-
 scripts/serve_local.py |  2 +-
 4 files changed, 29 insertions(+), 27 deletions(-)
 copy 404.html => 403.html (50%)

diff --git a/404.html b/403.html
similarity index 50%
copy from 404.html
copy to 403.html
index c5f2384..621875e 100644
--- a/404.html
+++ b/403.html
@@ -4,9 +4,9 @@
 		<meta charset="utf-8" />
 		<meta name=viewport content="width=device-width, initial-scale=1" />
 		<title>DPDK 404</title>
-		<link rel="stylesheet" href="/reset.css" />
-		<link rel="stylesheet" href="/layout.css" />
-		<link rel="stylesheet" href="/content.css" />
+		<link rel="stylesheet" href="http://dpdk.org/reset.css" />
+		<link rel="stylesheet" href="http://dpdk.org/layout.css" />
+		<link rel="stylesheet" href="http://dpdk.org/content.css" />
 		<script type="text/javascript">
 			var _gaq = _gaq || [];
 			_gaq.push(['_setAccount', 'UA-39229303-1']);
@@ -22,22 +22,23 @@
 	</head>
 	<body>
 		<header>
-			<h1><a href="http://dpdk.org/"><img src="/dpdk.png" alt="DPDK: Data Plane Development Kit"></a></h1>
+			<h1><a href="http://dpdk.org/"><img src="http://dpdk.org/dpdk.png"
+					alt="DPDK: Data Plane Development Kit"></a></h1>
 			<nav>
 				<ul>
-					<li><a href="/">Home</a></li>
-					<li><a href="/download">Download</a></li>
-					<li><a href="/doc">Documentation</a></li>
-					<li><a href="/dev">Development</a></li>
-					<li><a href="/ml">Mailing Lists</a></li>
-					<li><a href="/events">Events</a></li>
-					<li><a href="/news">News</a></li>
-					<li><a href="/about">About</a></li>
+					<li><a href="http://dpdk.org/">Home</a></li>
+					<li><a href="http://dpdk.org/download">Download</a></li>
+					<li><a href="http://dpdk.org/doc">Documentation</a></li>
+					<li><a href="http://dpdk.org/dev">Development</a></li>
+					<li><a href="http://dpdk.org/ml">Mailing Lists</a></li>
+					<li><a href="http://dpdk.org/events">Events</a></li>
+					<li><a href="http://dpdk.org/news">News</a></li>
+					<li><a href="http://dpdk.org/about">About</a></li>
 				</ul>
 			</nav>
 		</header>
 		<section>
-			<h2>404: page not found</h2>
+			<h2>403: forbidden</h2>
 			<p>This URL is not valid, sorry !</p>
 		</section>
 	</body>
diff --git a/404.html b/404.html
index c5f2384..d671e1e 100644
--- a/404.html
+++ b/404.html
@@ -4,9 +4,9 @@
 		<meta charset="utf-8" />
 		<meta name=viewport content="width=device-width, initial-scale=1" />
 		<title>DPDK 404</title>
-		<link rel="stylesheet" href="/reset.css" />
-		<link rel="stylesheet" href="/layout.css" />
-		<link rel="stylesheet" href="/content.css" />
+		<link rel="stylesheet" href="http://dpdk.org/reset.css" />
+		<link rel="stylesheet" href="http://dpdk.org/layout.css" />
+		<link rel="stylesheet" href="http://dpdk.org/content.css" />
 		<script type="text/javascript">
 			var _gaq = _gaq || [];
 			_gaq.push(['_setAccount', 'UA-39229303-1']);
@@ -22,17 +22,18 @@
 	</head>
 	<body>
 		<header>
-			<h1><a href="http://dpdk.org/"><img src="/dpdk.png" alt="DPDK: Data Plane Development Kit"></a></h1>
+			<h1><a href="http://dpdk.org/"><img src="http://dpdk.org/dpdk.png"
+					alt="DPDK: Data Plane Development Kit"></a></h1>
 			<nav>
 				<ul>
-					<li><a href="/">Home</a></li>
-					<li><a href="/download">Download</a></li>
-					<li><a href="/doc">Documentation</a></li>
-					<li><a href="/dev">Development</a></li>
-					<li><a href="/ml">Mailing Lists</a></li>
-					<li><a href="/events">Events</a></li>
-					<li><a href="/news">News</a></li>
-					<li><a href="/about">About</a></li>
+					<li><a href="http://dpdk.org/">Home</a></li>
+					<li><a href="http://dpdk.org/download">Download</a></li>
+					<li><a href="http://dpdk.org/doc">Documentation</a></li>
+					<li><a href="http://dpdk.org/dev">Development</a></li>
+					<li><a href="http://dpdk.org/ml">Mailing Lists</a></li>
+					<li><a href="http://dpdk.org/events">Events</a></li>
+					<li><a href="http://dpdk.org/news">News</a></li>
+					<li><a href="http://dpdk.org/about">About</a></li>
 				</ul>
 			</nav>
 		</header>
diff --git a/layout.css b/layout.css
index 9b06455..787e981 100644
--- a/layout.css
+++ b/layout.css
@@ -1,4 +1,4 @@
-@import url(/fonts.css);
+@import url(http://dpdk.org/fonts.css);
 
 html {
 	margin: 0 1em;
diff --git a/scripts/serve_local.py b/scripts/serve_local.py
index a18659f..63a0e59 100644
--- a/scripts/serve_local.py
+++ b/scripts/serve_local.py
@@ -37,7 +37,7 @@ class DPDK_Handler(BaseHTTPServer.BaseHTTPRequestHandler):
             self.send_response(200)
             self.send_header('Content-type', mimetype)
             self.end_headers()
-            self.wfile.write(f.read())
+            self.wfile.write(f.read().replace('http://dpdk.org', ''))
             f.close()
         except IOError:
             self.send_error(404, 'File Not Found: %s' % path)
-- 
2.7.0

             reply	other threads:[~2016-05-24 19:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-24 19:49 Thomas Monjalon [this message]
2016-05-26 12:35 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464119357-10064-1-git-send-email-thomas.monjalon@6wind.com \
    --to=thomas.monjalon@6wind.com \
    --cc=web@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).