This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Use custom URL for default search results page

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Use custom URL for default search results page Reply To: Use custom URL for default search results page

#40189
thebizpixiethebizpixie
Participant

You’re absolutely right that the redirect rule was not correct, and I should have checked it more closely. I also forgot that GET was required to make this all work as desired.

I have rewritten the rewrite rule to behave correctly, I believe:

RewriteCond %{QUERY_STRING} \\?s=([^&]+)\&(.*) [NC]
RewriteRule ^$ /search/%1/?%2 [NC,L,R]

such that the original search URL:

https://mydomain.com/?s=frog&asp_active=1&p_asid=1&p_asp_data=1&filters_initial=1&filters_changed=0&qtranslate_lang=0&current_page_id=36192

now redirects to the desired URL with the parameters attached:

https://mydomain.com/search/frog/?asp_active=1&p_asid=1&p_asp_data=1&filters_initial=1&filters_changed=0&qtranslate_lang=0&current_page_id=36192

but unfortunately the results on the redirected page are still not coming from Ajax Search Pro, but are instead the default WordPress results.

Another piece of the puzzle is that when I filter down my results on the redirected page using the settings box (and my custom field “content type”), the URL reverts to the default WordPress URL, but still does not override the results.

i.e. The URL changes to:
https://mydomain.com/?s=frog&asp_active=1&p_asid=1&p_asp_data=1&aspf%5Bcontent_type__1%5D%5B3%5D=Video&filters_initial=0&filters_changed=1&qtranslate_lang=0&current_page_id=36861

I don’t fully understand why this happens, but it might be a clue to part of what is going on.

Can you see any issues with this, or think of anything else that I could explore here?

Thanks for your input.