This is a bit old - you may or may not notice the date on this post but it's over a year old. That doesn't mean it's not useful but we all know how fast things chance on the web so there's a chance that techniques and technologies described here could be a little dated.

TradingEye show search query string in URL

I [heart] Trading Eye

Another Trading Eye hack for today. Very nicely the guys at DPI Vision have spent plenty of time making the URL’s search engine friendly. They’ve also done it with the site search however and if you want to track your search in Google Analytics (and you should do!) then you need to reverse that change.

But fear not it’s pretty straightforward! – Read on.

First thing as always it to back up your files – you’re looking for your .htaccess in the site route and modules/default/admin/templates/main/leftMenu.tpl.htm and anywhere else your search form is.

Once you’ve done that open your .htaccess in a text editor and look for somewhere around line 15 the following. (In some .htaccess files this is around line 24)


RewriteCond %{SERVER_PORT} 80
RewriteRule ^eaction/([^/]*)/([^/]*)(/)?$                       ecom/index.php?action=$1&mode=$2 [nc]

And change that to

RewriteCond %{SERVER_PORT} 80
RewriteRule ^eaction/([^/]*)/([^/]*)(/)?$                       ecom/index.php?action=$1&mode=$2 [nc,qsa]

The qsa means that any htaccess changes will amend the current query string rather than overwriting it.

Now you need to find your search form, for most installations I think it should be on the sidebar, in this instance,

modules/default/admin/templates/main/leftMenu.tpl.htm

Open up the template and find the starting tag for the search, it should look similar to the following.

[sourcecode language=”HTML”]