I need to redirect an URL with a variable, eg.http://www.mydomain.com/foo/55555 should go to http://www.mydomain.com/bar/55555 where 55555 is a variable number.Do I need to use redirect or rewrite?
Apache: rewrite or redirect?
apache httpd;variable;url
here's a RewriteRule that implements the redirect ([R])  RewriteRule ^/foo/([0-9]*)$ /bar?q=$1 [R]if you are using .htaccess to add your rewrite rules, you might want to make this local to the /foo directory, so put the following into foo/.htaccess:  RewriteRule ^([0-9]*)$ /bar&q=$1 [R]