Update permalinks to rewrite files matching query

Uses new route() helper.