Created
November 23, 2012 15:48
-
-
Save vrypan/4136206 to your computer and use it in GitHub Desktop.
smart redirects from 404 pages.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$.getJSON('/_/js/url_mapper.json', function(data) { | |
path = location.pathname.split("/") ; | |
if ( path[1] == "post" ){ | |
id = path[2]; | |
if ( data[id] ) { | |
$('#msg_en').html("The page you are looking has probably moved to \<a href=\"" + data[id] + "\"\>" + data[id] + "\</a\>.") ; | |
} | |
} | |
}); | |
// See http://blog.vrypan.net/2012/11/23/dynamic-404-for-static-blogs/ | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment