From e3b999dc0520df1cc7ed0a4f92080368e9728cb9 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Sat, 9 Feb 2013 14:25:06 -0800 Subject: Map URL rewrite .com/map/ID - Note this has domain name in it... --- .htaccess | 22 ++++++++++++---------- ajax/maps.ajax.php | 20 ++++++++++++++++++++ images/.htaccess | 5 ++++- index.php | 9 ++++++++- 4 files changed, 44 insertions(+), 12 deletions(-) create mode 100644 ajax/maps.ajax.php diff --git a/.htaccess b/.htaccess index 3bf8b20..30b2ace 100644 --- a/.htaccess +++ b/.htaccess @@ -1,24 +1,26 @@ AddType x-mapp-php5 .php - -ErrorDocument 400 http://www.mazetd.4xg.net/error.php?error=400 -ErrorDocument 401 http://www.mazetd.4xg.net/error.php?error=401 -ErrorDocument 403 http://www.mazetd.4xg.net/error.php?error=403 -ErrorDocument 404 http://www.mazetd.4xg.net/error.php?error=404 -ErrorDocument 500 http://www.mazetd.4xg.net/error.php?error=500 - +ErrorDocument 400 http://www.mazetd.4xg.net/errors.php?error=400 +ErrorDocument 401 http://www.mazetd.4xg.net/errors.php?error=401 +ErrorDocument 403 http://www.mazetd.4xg.net/errors.php?error=403 +ErrorDocument 404 http://www.mazetd.4xg.net/errors.php?error=404 +ErrorDocument 500 http://www.mazetd.4xg.net/errors.php?error=500 RewriteEngine on RewriteBase / +# Incase someone randomly put .html at the end. RewriteRule ^([a-z]+)\.html$ /?page=$1 [R,L] -# // For later use, when we get a domain that we want. +# Maintains www RewriteCond %{HTTP_HOST} ^mazetd.4xg\.net RewriteRule (.*) http://www.mazetd.4xg.net/$1 [R,L] - RewriteRule ^([a-z]+)$ /index\.php?page=$1 [QSA,NC] -# 480 weeks +# GetMap Re-write +RewriteRule ^map/(.*)$ /ajax/maps\.ajax\.php?mapid=$1 [QSA,NC] + + +# CSS and JS cache for 480 weeks Header set Cache-Control "max-age=290304000, public" diff --git a/ajax/maps.ajax.php b/ajax/maps.ajax.php new file mode 100644 index 0000000..d2ae750 --- /dev/null +++ b/ajax/maps.ajax.php @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/images/.htaccess b/images/.htaccess index 05bc7d9..cac0861 100644 --- a/images/.htaccess +++ b/images/.htaccess @@ -1,4 +1,7 @@ # 480 weeks Header set Cache-Control "max-age=290304000, public" - \ No newline at end of file + + +# Incase of missing images +ErrorDocument 404 http://www.mazetd.4xg.net/images/blank.png?error404=true \ No newline at end of file diff --git a/index.php b/index.php index 4eff377..a84fb19 100644 --- a/index.php +++ b/index.php @@ -71,7 +71,9 @@ $footerLinks['#top'] = "Back to Top"; //Links appear in order. $Links['home'] = "Home"; -$Links['scores'] = "Scores"; +//TODO: Delete + $Links['oldleaderboard'] = "Old ScorePage..."; +$Links['scores'] = "Scores BETA!"; $Links['challengelist'] = "Challenges BETA!"; //$Links['howtoplay'] = "How to Play"; //$Links['tutorial'] = "Tutorial"; @@ -149,6 +151,11 @@ switch ($request) { require("pages/howtoplay.php"); break; + //TODO: DELETE: + case "oldleaderboard": + require("pages/oldleaderboard.php"); + break; + //Support older links. case "leaderboard": header("Location: $mydomain"."scores?date=".$_GET['date']); -- cgit v1.2.3