views:

115

answers:

1

I thought that apache mod_rewrite would hide the URL that is being redirected to. i.e. if a user enters http://site.com/iPhone and i've set it up to redirect to http://site.com/search.php?search=iPhone I would have expected that http://site.com/iPhone would still be displayed in the address bar?

.htaccess file is:

<IfModule mod_rewrite.c>
RewriteEngine on 
Options +FollowSymlinks
RewriteBase / 
RewriteRule ^search/(.*) search.php?search=$1 [R]
</IfModule>

Have I got this completely confused?

+10  A: 

The [R] modifier causes the response to be redirected to the new URL, rather than handled in-place. Ditch that, and it ought to work (any other problems notwithstanding).

When I'm doing URL rewriting, I like to keep the mod_rewrite cheat sheet from Added Bytes (formerly ILoveJackDaniels) to hand.

Rob