Posts Tagged ‘regex’

Simply rewrite your search url to seo freindly.

http://www.yoursite.com/search.php?keyword=flowers
to
http://www.yoursite.com/search/flowers

Add the following code into your htaccess file

RewriteEngine on
RewriteRule ^search/(.*)$ search.php?keyword=$1

you can access the seach keyword in search.php page like this
$text_to_search = $_GET[‘keyword’];

Advertisements