From bb3dfce2fa457f628ed783b57337b398c579040d Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Thu, 30 May 2013 15:04:20 -0500 Subject: [PATCH] Redirect old battles to their corresponding replay --- .htaccess | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.htaccess b/.htaccess index 613742eb0..0024eff59 100644 --- a/.htaccess +++ b/.htaccess @@ -21,6 +21,14 @@ RewriteRule ^(.*) http%{ENV:P_SUFFIX}://play.pokemonshowdown.com/$1 [R=301,L] RewriteRule ^style/font/.*?\.(eot|svg|ttf|woff)$ - [E=SAFE_RESOURCE:1] Header set Access-Control-Allow-Origin * env=SAFE_RESOURCE +# Redirect old battles to their corresponding replay +RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC] +RewriteRule ^battle-([A-Za-z0-9]+-?20[0-6][0-9]{5})$ http%{ENV:P_SUFFIX}://pokemonshowdown.com/replay/$1 [R=302,L] +RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC] +RewriteRule ^battle-([A-Za-z0-9]+-?1[0-9]{7})$ http%{ENV:P_SUFFIX}://pokemonshowdown.com/replay/$1 [R=302,L] +RewriteCond %{HTTP_HOST} ^play\.pokemonshowdown\.com$ [NC] +RewriteRule ^battle-([A-Za-z0-9]+-?[0-9]{1,7})$ http%{ENV:P_SUFFIX}://pokemonshowdown.com/replay/$1 [R=302,L] + # TODO: fix bug where you can't join lobby directly RewriteRule ^lobby/?$ / [R=301,L]