RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^/?$ "http\:\/\/www\.#*$!xx\.#*$!\/NEW-FOLDER" [R=301,L]
You're coming to Apache from some other language, aren't you? You're escaping \ a bunch of things that don't need to be escaped-- including some that will be interpreted as literal backslashes.
%{HTTP_HOST} ^.*$
Would seem to mean "There may or may not be a host" (making the whole line superfluous). What is it intended to mean?
RewriteRule ^/?$ "http\:\/\/www\.#*$!xx\.#*$!\/NEW-FOLDER" [R=301,L]
Request consists of a single slash, or nothing-- in other words, request is for domainname alone. (This would not work on my server, but may work for you.)
rewrite_rule doesn't need quotation marks.
In the target, nothing is escaped. Even in patterns, colons and slashes do not need escaping. (I smell Javascript ;)) What you
do need to escape in all patterns is the literal period . so you don't end up matching "tldxcom" and the like.
So in your first post you're rewriting to
http://www.example.com/NEW-FOLDER
RewriteRule ^(.*)$ /NEW-FOLDER/$1
This should work. Combined with the conditions, it means "take any and all incoming requests
except the ones that already say /NEW-FOLDER/ and shunt them over to NEW-FOLDER."
Note that you don't actually need the ^ and $ anchors. By default, Regular Expressions will capture everything in sight.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
Do the files in their original locations (the ones without NEW-FOLDER) still exist? If so, you can't use this pair of conditions, because they mean "apply the rule only if the requested file or directory
doesn't exist". In fact you may need the other pair, -f and -d without !, meaning "If there is a request for a real file or directory". Just keep careful track of /NEW-FOLDER/ to avoid infinite loops.