I've browsed the forums as a guest before so I know about the no spoon feeding rule.

Here's the situation, I'm on my network using my Linux laptop to do a MitM attack on my Windows XP SP3 desktop. The MitM works flawlessly and so far all the ettercap plugins work and so do some of the simple filters I've gathered. I bumped across the filter that redirects web pages to whatever page you want it to by inserting javascript into the body of the page.

if (ip.proto == TCP && tcp.dst == 80) {
if (search(DATA.data, "Accept-Encoding")) {
replace("Accept-Encoding", "Accept-Rubbish!");
msg("changed Accept-Encoding!\n");
if (ip.proto == TCP && tcp.src == 80) {
replace("<BODY", "&#x000D<BODY onload=\"javascript:document.location.href='SITE HERE'\"><XSS a=");
replace("<body", "&#x000D<body onload=\"javascript:document.location.href='SITE HERE'\"><XSS a=");
msg("Filter Ran.\n");
Code works for me, sorta.

What I want to do is redirect traffic from my target to a youtube page that plays a video I found because I think it would be great to use on my friends that are on my network when they come over. I loaded up the filter and it seemed to work just that every time the page fully loaded, it would simply just reload the page due to the filter being run on the page again. What I thought would fix it is if you added an if then statement into the filter to check to see if it was already on the page you want the target to be on and if not go ahead and do the redirect, that way I don't have to guess at the timing and disable filtering when the page loads. Problem being, I can't quite grasp how to set that up in terms of an ettercap filter. All my attempts thus far have ended in the filter not compiling or just not working, I would even settle on a universal filter that redirected all links on a page to the desired URL. Any help or suggestions would be greatly appreciated.

P.S. If you want a really fun trick that from what I've seen completely makes any site unusable, replace spaces with question marks or any other character you feel like at the time.