I think this would be more appropriate done on the server side, where we wouldn't have to backtrack by reasoning things out based on the URL.