views:

17

answers:

1

Hi,

I have the following URL:

http://testhost.com/offers/311/133/[email protected]/

and I'm wanting to redirect it to this url:

http://testhost.com/offers/311/133/test_at_test.com/

Can someone provide me with the Rewrite Conditions and Rule to do this?

Thanks in advance!

+2  A: 

Try this rule:

RewriteRule ^([^@]*)@(.*) /$1_at_$2

For an external redirect, add the [R,L] flag.

Gumbo
Thanks for that! Can you please explain to me what [R,L] means?
Jesse Bunch
@Jesse Bunch: The *R* flag is to explicitly cause an external redirect instead of an internal. And the *L* flag (*last rule*) is to abort the rewriting process. See also [rewrite flags](http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriteflags).
Gumbo