[Zope] Redirecting to an "under construction" page
Dennis Allison
allison at sumeru.stanford.EDU
Tue Dec 9 12:47:58 EST 2003
There's another, simpler approach. Write a simple server and use it
rather than Zope. YMMV depending upon your site configuration.
Something like this should do the job...
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import StringIO
message = '''<HTML>
<HEAD><TITLE>Announcement</TITLE></HEAD>
<BODY>
<center>
<table width=300><tr><td>
<tr><td>
<center><h1>Under Construction</h1></center><p>
<h2>Please accept our appologies for any
inconvenience.</h2> </p>
</td></tr>
</table>
</center>
</BODY>
</HTML>
'''
PORT = 80
class MyHTTPRequestHandler( SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
"""Serve a GET request."""
f = StringIO.StringIO(message)
if f:
self.copyfile(f, self.wfile)
f.close()
Handler = MyHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), Handler )
print 'serving at port ', PORT
httpd.serve_forever()
On Tue, 9 Dec 2003, Paul Howell wrote:
> At 11:01 AM 12/9/2003, Gilles Lenfant wrote:
> >Hi,
> >I need all URLs of a Zope site to be temporarily redirected to an "under
> >construction" page.
> >http://www.foo.com/any/path?any=query
> >-->
> >http://www.foo.com/underconstruction_html
>
> 1. Use VirtualHostMonster to point www.foo.com domain traffic to a
> different folder within Zope. Works well on naked Zope if you use the
> mapping settings.
> 2. Rewrite the URLs for www.foo.com in your Apache directives if you run
> Zope behind Apache.
> 3. In designing your site, consider using a common header file that every
> page aquires... use it when you need to add something (like a redirect)
> across your whole site. In the old days this might be <dtml-var
> standard_html_header>.
>
> I like #1 and #2 better overall - point traffic away from your site, and
> create subdomain test.foo.com for your development purposes. Then when
> it's ready, repoint foo.com and www.foo.com toward the materials you have
> finished.
>
> =Paul
>
>
> _______________________________________________
> Zope maillist - Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
>
More information about the Zope
mailing list