2

Can anyone help me with URL rewriting using Solspace SuperSearch as our SEO guys have suggested that these could be improved:

We have 5 dropdowns for make, model, fuel type, min price and max price. The form uses POST. Examples of the search results generated pages are:

Blank Form http://www.motors.coop/search/results/search&cf_make=&cf_fuel=&cf_price-from=0&cf_price-to=50001/

Make Only http://www.motors.coop/search/results/search&cf_make=Audi&cf_model=&cf_fuel=&cf_price-from=0&cf_price-to=50001/

Diesel Only http://www.motors.coop/search/results/search&cf_make=&cf_fuel=Diesel&cf_price-from=0&cf_price-to=50001/

Standard stuff, you'll agree. What our SEO company has suggested that these be re-written to something like this:

http://www.motors.coop/search/bmw/diesel/5001/18000

I agree that these are cleaner - is there a regex someone can suggest that can achieve this? The big issue is a user may not necessarily choose anything from any of the dropdowns. In this case, can the URL be something like:

http://www.motors.coop/search/all/all/all/1/100000

Hope someone can help. Thanks in advance.

1

Have a look at Template Routes by Rob Sanchez. You should be able to setup a route with wildcards in a set order, then match those to each part of the segment that Super Search needs. Something like:

$config['template_routes'] = array(
    'search/:any/:any/:any/:num/:num' => 
    'search/results/search&cf_make=$1&cf_model=$2&cf_fuel=$3&cf_price-from=$4&cf_price-to=$5'
);

The other thing you'd have to do is make your search form redirect to the clean URL, but that should be fairly easy.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.