I've my wordpress inside a sub-folder on my small domain having a .htacess file around the root which does all of the redirecting.

i wish to perform a redirect, the website IP to www. which works best for the primary site around the root although not for that sub-folder that is Wordpress.

iv got a sense wordpress is overwriting this some place?

this is exactly what iv utilized in root .htacess

RewriteCond %{HTTP_HOST} ^IP.IP.IP.IP [NC] 
RewriteRule ^(.*)$ http://www.NAME.com/$1 [R=301,L] 

but this doesn't work with the wordpress sub-folder iv even attempted copying this in to the .htaccess file within the Wordpress root folder but nonetheless not work

anyone got any idea ????

For the reason that inside your Wordpress wordpress-admin panel there's an environment:

Settings -> General -> WordPress address (URL)

and

Settings -> General -> Blog address (URL)

Make certain to update these to http://www.domain.com/subfolder it will begin working.

UPDATE (According to your comments)

Use following .htaccess inside Wordpress install folder '/blog'

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteBase /blog/

RewriteRule ^/?$ /blog/index.php [L]

RewriteCond %{HTTP_HOST} ^IP\.IP\.IP\.IP$
RewriteRule . http://www.NAME.com%{REQUEST_URI} [R=301,L]

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>

# END WordPress

.htsccess file overrides the .htaccess files within the parent sites. Inside your situation, the WordPress blog directory includes a .htaccess file that is overriding the .htaccess file within the root. For this reason the thing is it employed by the main, although not for that subdfolder, say, /blog.

You shouldn't be changing the .htaccess produced by WordPress. Add the rewrite rules within the existing .htacess file within the subdirectory and make certain this is actually the first rule within the file(i.e inside <if ...> block). If you work with Wordpress Super Cache or similar wordpress plugin, make certain you produce a new if block over the rules produced through the plug ins and then leave the WordPress produced <if ...> block intact.

<edit>

Inside your root folder,

RewriteCond %{HTTP_HOST} ^IP\.IP\.IP\.IP [NC]  
RewriteRule ^(.*)$ http://www.NAME.com/$1 [R=301,L]  

Inside your Wordpress directory(WPDIR) .htaccess file before every other rule,

RewriteCond %{HTTP_HOST} ^IP\.IP\.IP\.IP [NC]  
RewriteRule ^(.*)$ http://www.NAME.com/WPDIR/$1 [R=301,L]  

Obviously, place it within the <if ...> block and turn the RewriteEngine on.