The URL is the following http://local.example.com/features.html and what I need is to add a text like "country" http://local.example.com/us/feature.html but with the code I have when I click on the URL the site shows a 404 error
This is only visual without creating a US sub-folder.
The code...
RewriteEngine On
RewriteCond %{HTTP_HOST} local.example.com$ [NC]
RewriteCond %{HTTP_COOKIE} location=us [NC] --> CHECK COOKIE FOR ACTION
RewriteCond %{REQUEST_URI} !^/us/ --> EXCLUDE US FOR REDIRECT LOOP
RewriteCond %{REQUEST_URI} !^/blog/ --> EXCLUDE BLOG FOLDER WITH WORDPRESS
RewriteRule ^(.*)!\.(css|js|png|jpg)$ http://local.example.com/us/$1 [R=302,L]
RewriteRule ^(.*)!\.(css|js|png|jpg)$ http://local.example.com/us/$1 [R=302,L]
The RewriteRule pattern will not match the requested URL (because of the erroneous !) so this directive won't actually do anything. From this I also assume you are wanting to exclude requests for CSS, JS, .png and .jpg files? You also have a condition that excludes requests made to a /blog/ subdirectory, however, you've not mentioned this in your question?
You also reference a cookie in the code? However, you've not mentioned this in your question and this won't work in its current state (since it won't be present on initial requests), so I'll ignore this for now.
Try the following instead:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^local\.example\.com$ [NC]
RewriteCond %{REQUEST_URI} !\.(css|js|png|jpg)$
RewriteCond %{REQUEST_URI} !^/blog/
RewriteRule !^us/ /us%{REQUEST_URI} [R=302,L]
The above states, given a request for /foo/bar...
/us/Host local.example.com.css, .js, .png or .jpg/blog//us/foo/barUnless you have multiple hosts on this account, you don't need to explicitly check the Host header as part of the rule?