Autotrader.ca, Please Fix Your Search.

Autotrader.ca your search is not very good!

I just did a search for “all cars newer than 2000, between $2500 and $5000 excluding damaged vehicles, in descending order by Kms.” Sounds pretty complex when you write it out in English, but that should be a fairly straight-forward SQL query. Came across a couple of pretty serious problems there.

Your premium listings do not obey my sort selections, they simple appear in whatever position the advertiser has paid for. This would be somewhat forgiveable if the premium listings where displayed separately, a la Google ad words. Even though they are on a yellow background, as a first time visitor I had not yet scrolled down to notice that the regular listings are on a white background. So I assumed that your sort feature was broken, in fact I probably wasted a minute clicking the sort link until finally giving up and scrolling down. It was then that I realized exactly what was going on. I don’t know if there’s a good way to fix this from a user interface standpoint, you may just want to increase the size of the “Premium Listings” header text and/or do something else to make it stand out more clearly. In my opinion selling premium listings is pretty lame, your profit margins online have got to be much higher than in print. At the very least, drop the ordering of the premium listings, so that I’m able to apply a sort to those listings as well.

Secondly, I came across something much worse.

This 2003 Hyundai Tiburon came up in my search even though I specifically excluded vehicles with damage. I’m sure that your search engine code is fine. I’m sure the problem is a lack of data. The seller of that car probably did not provide you with data about it’s “damaged” status. But you see, thing is, if such an obviously damaged car shows up in my search, then how can I be sure than all of the other results that appear fine don’t have some less obvious damage? This oversight makes your search engine completely untrustworthy! I know how had it can be to get good data from users, but seriously, have you data entry monkeys flag adverts with photos like these.

P.S. ASP sucks, drop your Microsoft licenses and you’ll make more than enough money to drop those lame premium listings.

P.S.S. Trasparent divs with background images is a lame way to block hotlinking of images. Just block access to your image files from off-site referers in … oh wait, that’s not possible with IIS. See previous PS.

.htaccess Mobile Browser Redirect

Checkout the latest version of the ruleset first.
I just finished building out a simple little mobile site for hiphopdx.com. When I asked Google the best way to detect mobile browsers with PHP, it led to me this PHP code by Andy Moore. After a few minutes of contemplating the best way to include the code in the existing CMS framework I realized that it would probably be best to move the functionality outside of PHP. I mean, why clutter up display code with HTTP traffic manipulation. The website’s main traffic cop Apache is already perfectly capable of handling the duties already.

Here’s how to redirect mobile traffic using a .htaccess file:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/m/.*$
RewriteCond %{HTTP_ACCEPT} "text/vnd.wap.wml|application/vnd.wap.xhtml+xml" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "dang|doco|eric|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT}  "maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "wapp|wapr|webc|winw|winw|xda|xda-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "up.browser|up.link|windowssce|iemobile|mini|mmp" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "symbian|midp|wap|phone|pocket|mobile|pda|psp" [NC]
RewriteCond %{HTTP_USER_AGENT} !macintosh [NC] #*SEE NOTE BELOW
RewriteRule ^(.*)$ /m/ [L,R=302]

I did my best to translate the PHP code verbatim, if you want to understand what each line is doing you’ll want to check out the original code. Testing for all those user agents is probably a little overkill, but Mr Moore is a “dotMobi certified mobile web developer” I’m going to assume he knows what he’s talking about.

*The “tosh” user agent (I’m assuming this is for a Toshiba browser?) happens to catch browser on any browser on the Mac OS. I had to add !macintosh to skip macs. The iPhone/iPod Touch does not identify itself as “macintosh.”