How To: Hack Default Wordpress Search URL to better SEO friendly URL

seo wordpress search url

I am guest author at couple of wordpress hosted blogs and have also used it at my own basis, I have noticed that the default wordpress search URL is not that much good for SEO (Search Engine Optimization) Well, this post is basically for all wordpress (Custom Hosted) owners. I hope after hacking or tweaking the url you will surely get some extra traffic, as increasing your blog traffic is always been most important, Today hackersthirst is also getting good response and i thank to all my readers for there good response and feed back. Now, Whenever you search at any wordpress based site, the url will be like this:
And this is quite unfriendly if we examine results it on the base of SEO. I,ll give you handy tips that how can we hack it to change the URL. You will notice that after the implementation the request url will not be /?s= anymore, it will be changed into /search/%2522searched+term%2522 , this will be surely much better for search engine to read. We can achieve our goal by using the two methods which i will discuss here, One is by the use of plugin and other one is by the use of .htaccess file (Learn how to secure your blog by using .htaccess file). By using these hacks we are going to redirect our wordpress search URL to new one.

Steps to Hack Wordpress Default Search URL to SEO friendly:

1) Its a php script, by redirecting the search result to another url using php predefined variables : $_SERVER[REQUEST_URI]
it’s a wordpress plugin called Nice Search, ready to use, just download and install it from your dashboard after getting logged into your wordpress blog as admin, here is its php source code:

2) Just edit the .htaccess file and put the following rules in it i-e rewrite rule:
RewriteEngine on
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /(#[^?&\ ]*)?\?([^&\ ]*&)?s=([^&\ ]+)[^\ ]*\ HTTP/
RewriteRule ^(.*) /search/%3? [R=301,L]
I,ll recommend the use of .htaccess file since it will load first and also if it will load first then implementation of the hack will also be fast. If you can't access .htaccess file of your host then use first method.