I need ideas on how to redirect a ton of pages to the root page (/). I am currently using this code for every page request to check if it needs to be redirected.

```
switch ($url) {
 case '/test.htm':
 case '/test2.htm':
 ....
 ....
 ....
     $redirect='/'; break;
}

```

I will then use 301 redirect to redirect the page.

But the problem with this approach is that I have more than 1000 urls, and the current page will be checked with all of the 1000 urls in that list, which is both time and resource consuming. Any better approach?