ALLOW_TEST = False DEFAULT_URL = 'http://blog.dantup.com/' from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app from google.appengine.api import mail import webob, urlparse, logging # Old Domain: New Domain, Map urls (else redirects to root) urls = { 'www.dantup.com': ('blog.dantup.com', False), 'www.dantup.me.uk': ('blog.dantup.com', False), 'www.tuppeny.com': ('blog.dantup.com', False), 'dantup-redir.appspot.com': ('blog.dantup.com', False), 'blog.dantup.me.uk': ('blog.dantup.com', True), 'feeds.dantup.me.uk': ('feeds.dantup.com', True), 'wavenotifier.dantup.me.uk': ('wavenotifier.dantup.com', True), 'wavenotifier.tuppeny.com': ('wavenotifier.dantup.com', True), 'go.dantup.me.uk': ('go.dantup.com', True), 'go.tuppeny.com': ('go.dantup.com', True), } test_urls = [ 'http://www.dantup.me.uk', 'http://www.dantup.me.uk/', 'http://www.dantup.me.uk/blah', 'http://www.dantup.com', 'http://www.dantup.com/', 'http://www.dantup.com/blah', 'http://www.tuppeny.com', 'http://www.tuppeny.com/', 'http://www.tuppeny.com/blah', 'http://blog.dantup.me.uk', 'http://blog.dantup.me.uk/', 'http://blog.dantup.me.uk/2010/mytest', 'http://feeds.dantup.me.uk', 'http://feeds.dantup.me.uk/', 'http://feeds.dantup.me.uk/2010/mytest', 'http://wavenotifier.dantup.me.uk', 'http://wavenotifier.dantup.me.uk/', 'http://wavenotifier.dantup.me.uk/2010/mytest', 'http://wavenotifier.tuppeny.com', 'http://wavenotifier.tuppeny.com/', 'http://wavenotifier.tuppeny.com/2010/mytest', 'http://go.dantup.me.uk', 'http://go.dantup.me.uk/', 'http://go.dantup.me.uk/mytest', 'http://go.tuppeny.com', 'http://go.tuppeny.com/', 'http://go.tuppeny.com/mytest', ] class MainHandler(webapp.RequestHandler): def get(self): # If we're allowed to test (eg. local), and requested /test, then output the test if ALLOW_TEST and self.request.path == '/test': self.response.out.write('
| ' + test_url + ' | ' + get_redirect_url(test_url) + ' |