Forum Discussion
hooleylist
Jan 13, 2010Cirrostratus
Hi Ray,
You're doing a check on the host header value and the URI. But then you're doing a separate check of the URI with the switch statement. A URI couldn't match /newbooks/newresources and any of the specific switch cases so everything which matches the first check for /newbooks/newresources would hit the default switch case.
If you're not using wildcards in the switch cases, you could remove the -glob flag from the switch statement.
Also, I assume the author names are not literally author[1-x]? If they're unique names and you only want to redirect specific names to new author-specific locations, I'm not sure there is a way to trim down the number of switch cases. If the names were part of a general pattern, you might be able to replace the non-default switch cases with one case. Can you provide a few sample original URIs you want to redirect and their corresponding redirect locations using more exact names?
Aaron