Don’t have time to install + test this myself, but sendRedirect with header should include the entire header, not just the numeric code (at least according to the Wiki)
http://wiki.modxcms.com/index.php/API:sendRedirect
plugin code: $modx->sendRedirect($pageUrl, 0, "REDIRECT_HEADER", "301"); // Send a permanent redirect
suggested usage acc. to API doc: $modx->sendRedirect($pageUrl, 0, "REDIRECT_HEADER", ’HTTP/1.1 301 Moved Permanently’);
Also,
if ($found)
can be a bit misleading. $found is already defined (as zero). It would probably be safer to use:
if($found < 1)
The plugin either produces a redirect 301 via modx API, or a 404 header. If you get neither of those, and you’re sure you’ve setup the TV stuff correctly, the redirect 301 code block is probably the culprit.