[ic] Rewriting URLs for SEO purposes - help!

Cameron G ritontor at icenet.com.au
Tue Apr 12 03:54:44 EDT 2005


> -----Original Message-----
> From: interchange-users-bounces at icdevgroup.org 
> [mailto:interchange-users-bounces at icdevgroup.org] On Behalf 
> Of Jamie Neil
> Sent: Monday, 11 April 2005 8:21 PM
> To: interchange-users at icdevgroup.org
> Subject: Re: [ic] Rewriting URLs for SEO purposes - help!
> Cameron G wrote:
> > Which is nice, except I'm still left with a URL that isn't terribly 
> > search engine happy. That's why when a client wants to buy a claw 
> > hammer, I'd like the url for him to read
> > 
> > http://www.store.com/hammers/clawhammer.htm
> > 
> > Or even
> > 
> > http://www.store.com/hammers.htm
> > 
> > And have that invisibly map to whatever it needs to in the 
> background, 
> > all the while presenting that clean, simple, keyword happy 
> URL to both 
> > the client and the SE bots.
> There's two stages to this:
> 1) Use URL rewriting to clean up the root path.
> 2) Use an actionmap to convert the rest of the path to a search.
> Here's how we do it:
> --------------------

[example snipped for brevity]


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} =
   $CGI->{mv_sort_field} = 'category,price,description';
   $CGI->{mv_sort_option} = 'f,f,n,f';
   $CGI->{mv_search_field} = "category";
   $CGI->{mv_searchspec} = "$product";
   return 1;

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... 

More information about the interchange-users mailing list