views:

29

answers:

1

In Wordpress, I have set the permalink structure like this: /%category%/%postname%

After creating a custom search page, I now have the following URL:
http://mypage.com/search?foo1=bar&foo2=&foo3=&foo4=

I have two questions:

1) How can I transform this url so that I get to e.g. http://mypage.com/search/foo1/bar ?

2) Is there a way I can remove the "unused" parameters? (&foo2=&foo3=&foo4=)

I found this post, pointing me to parse_request function in Wordpress, and this post talking about mod_rewrite. But not quite sure how to proceed, or what method is better to use.

A: 

you can use both the methods parse_request() function of wordpress or mod_rewrite for transforming your url, but for that to work properly you will have to write a function that catches the requested url and translates it into original url to serve the request.

Pragati Sureka