I’m having a problem with wordpress rewriting my URLs, basically I have a regular search form with method set as GET, when I submit it the URL looks like this at first:

http://mysite.com/news/?type=My+Variable

WordPress adds the + symbol to separate the string and the results show fine, but when I click on the previous posts link the URL changes to:

http://mysite.com/news/page/2/?type=MyVariable

Since the type parameter is now MyVariable it shows me no results, it doesn’t matter if I type the + sign directly in the URL, when I press ENTER it just gets removed.

It seems to be related to how wordpress handles canonical URLs but I’m not sure about it, can anyone help me?

Thanks in advance.

1 Answer
1

I don’t think this will solve your problem, but take a look at url_encode().

$pagination['add_args'] = array('s'=>urlencode(get_query_var('s')));

Leave a Reply

Your email address will not be published. Required fields are marked *