[ic] Rewriting URLs for SEO purposes - help!

Jamie Neil jamie at versado.net
Tue Apr 12 04:29:35 EDT 2005


Cameron G wrote:
> Ok Jamie, I think I'm on the right track with this one now. I slapped your
> ActionMap in to my config unedited, and the error log returned "Bad data
> selector='dept' field='name' key='(my search term)'", which is good, because
> I'm pretty sure that means it was looking for a "dept" table in my db, which
> I don't have. So anyway, I whittled your code down to the barest of
> functionality that I actually require, which is for it to take a single
> keyword and pass it to results.html. Here's the actionmap I've got so far...
> 
> ActionMap  test  <<EOR
> sub {
>    my $product = shift;
>    $CGI->{mv_coordinate} = 'yes';
>    $CGI->{mv_search_file} = 'products';
>    $CGI->{mv_search_page} = 'results.html';
>    $CGI->{mv_searchtype} = 'db';
>    $CGI->{mv_todo} ='search';
>    $CGI->{mv_return_fields} =
> 'sku,prod_group,category,image,description,contains,price';
>    $CGI->{mv_sort_field} = 'category,price,description';
>    $CGI->{mv_sort_option} = 'f,f,n,f';
>    $CGI->{mv_search_field} = "category";
>    $CGI->{mv_searchspec} = "$product";
>    $Tag->update('process');
>    return 1;
> }
> EOR
> 
> 
> Now, as far as I can gather, that is basically what I want, except, well, it
> doesn't work. I'm calling it with http://www.store.com/test/product.html.
> Nothing in the error log, and the debug log is just showing an attempt to
> retrieve a "select * from products" - which atleast proves it's *half*
> working. I understand that I may have to strip the .html off the end of the
> string passed through, but that's ok. Can anyone see what I might have done
> wrong here? I'm by no means an IC expert, but I've kludged a few things in
> the past, and right now I *feel* like I'm close, but I could still be a
> million miles away... 

Maybe too much whittling? Try adding:

$CGI->{mv_column_op} = "rm";

Change:
...
my $product = shift;
...
$CGI->{mv_sort_option} = 'f,f,n,f';
...

to:
...
my ($action, $product) = split ('/', shift);
...
$CGI->{mv_sort_option} = 'f,n,f';
...

See if that helps.

-- 
Jamie Neil | <jamie at versado.net> | 0870 7777 454
Versado I.T. Services Ltd. | http://versado.net/ | 0845 450 1254


More information about the interchange-users mailing list