The use of RewriteRule to perform this task may be appropriate if there are other RewriteRule directives in the same scope. This is because, when there are Redirect and RewriteRule directives in the same scope, the RewriteRule directives will run first, regardless of the order of appearance in the configuration file.
running these rules in the wrong order may cause: - exposure of mod_rewrite-rewritten urls in a subsequent mod_alias Redirect (likely what caused your /smartoptimizer/ redirect) - multiple redirects to reach the canonical url
RewriteRule ^(.*\.(js|css))$ smartoptimizer/?$1
are you trying to pass the file name in a query string to the default directory index document for the /smartoptimizer/ directory?