The redirect target should include domain name and protocol.
Change the .* pattern to be something more selective, as those are very inefficient needing hundreds of trial matches for each request. Something like
([^/]+)
might be better.
RewriteRule cannot see the leading / of URL requests when used in .htaccess so you'll need to remove it.
WakeCow
4:20 pm on Mar 15, 2010 (gmt 0)
This one worked RewriteRule ^oldurl/([a-z0-9]+)/([0-9]+)/$ http:\\%{HTTP_HOST}/newurl/$1/$2/ [NC,R=301,L]
g1smd
4:37 pm on Mar 15, 2010 (gmt 0)
That should work, but it will redirect all non-www requests to non-www and all www requests to www.
If you have an additional domain canonicalisation rule for redirecting non-www to www, the effect will be a double redirect for non-www old URLs. This redirection chain should be avoided.
It is often best to specify the actual domain name in the rule, rather than use the %{HTTP_HOST} placeholder.
There's related discussion in several threads linked from: [webmasterworld.com...]
Since this is a redirect, you can also make the trailing slash of the original request optional by adding a question mark to the pattern. In that way, requests for both