Create a file called .htaccess in the root directory of your site and put it in it.
RewriteEngine on Options +FollowSymlinks RewriteBase / RewriteRule ^(.*) search.php?search=$1 [R]
Gotta do the trick.
I would suggest, however, that you make this a little more specific, so maybe you need a search directory user in your url. for example, instead of mysite.com/IPhone use mysite.com/search/IPhone, which will work as
RewriteEngine on Options +FollowSymlinks RewriteBase / RewriteRule ^search/(.*) search.php?search=$1 [R]
This makes it easier to work with regular pages that are redirected to arnt, for example, about us or the base page.
As Chris says, this is not PHP, but Apache, which does this, and whether it works, may depend on your hosting setup.
Toby allen
source share