I need to redirect an URL with a variable, eg.
http://www.mydomain.com/foo/55555 should go to
55555 is a variable number.
Do I need to use redirect or rewrite?
RewriteRule that implements the redirect (
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
RewriteRule ^([0-9]*)$ /bar&q=$1 [R]