How to rewrite the url of search result page?

Hi,
the url of search result page is like: https://www.youdomain.com/?match=all&subcats=Y&pcode_from_q=Y&pshort=Y&pfull=Y&pname=Y&pkeywords=Y&search_performed=Y&q=is+a+b+4&dispatch=products.search
If I hope it rewrite into https://www.youdomain.com/is-a-b-4/s?k=is+a+b+4, which will be fit for SEO, the ChatGPT tell me to add this rule into Nginx rewrite rule:

if ($args ~* "match=all&subcats=Y&pcode_from_q=Y&pshort=Y&pfull=Y&pname=Y&pkeywords=Y&search_performed=Y&q=([^&]+)&dispatch=products.search") {
        set $search_query $1;
        rewrite ^ /$search_query/s?k=$search_query redirect;
    }

If ChatGPT is right , what will be the whole code?

This is only half of the path, as the URL of the search results page generated by the store will still be the same.

Such a modification will require changes in the installation’s code. Most possibly, such changes can achieved without making any changes in the server configuration. You can contact our certified partners for the necessary implementation.

Hi,
The cs cart‘s search result page like https://www.sample.com/?match=all&subcats=Y&pcode_from_q=Y&pshort=Y&pfull=Y&pname=Y&pkeywords=Y&search_performed=Y&q=mobile+charger&dispatch=products.search is too long and too complicated, I hope all search resuld pages should be rewrited like https://www.sample.com/mobile-charger/s?k=mobile+charger. How can I do it?
Thanks.

Install, activate, and set up the SEO addon from CS-Cart (should be part of the default cart software).

Tthe default SEO ADDON can not do it on this.

Quite complex modification in the SEO module is required to do it. If you need to do it for several URLs only (e.g. for promotion purposes), you can use our module

Thank you for your suggestion, what I need is not a single or a few URL rewrites, I have hundreds of thousands or more of these URLs to rewrite.

1 Like

In this case hire someone to create such a modification for you