I run another website which I is hosted on Linux/Apache, and for a while I ran a forum on it. However the forum was never used, apart from spam bots, so I removed it. I later discovered that huge amounts of bandwidth was being taken up by spam bots trying to spam the now non-existent forum, each one being served a nice 404 message and taking up processing time on my site, so I decided to forbid access to it.
The forum sat at: http://
RewriteRule ^forum($|/) - [F]
This is a rewrite rule, for any path after /forum, that results in the following "403" forbidden message:
Forbidden You don't have permission to access /forum on this server.
This is exceptionally lightweight and does not trigger a 404. Problem solved!
If you want do a simple redirect, perhaps becuase you have changed your structure, this is even more simple. Just use teh "Redirect 301" command as per the example below:
Redirect 301 /top-tens/bestselling-electronics/bestselling-televisions/bestselling-sony-televisions/ http://www.mysite.co.uk/top-tens/electronic/bestselling-televisions/ Redirect 301 /top-ten/watches/omega/ladies http://www.mysite.co.uk/top-tens/best-selling-omega-watches/
Please note that the "from" URL must be a relative URL, whilst the "to" URL is the full URL including domain.