Jump to content
Sign in to follow this  
gdfwilliams

All Products = Spider Food

Recommended Posts

One of the many useful recommendations at SearchEngineWorld.com:

This is a very cheap but effective trick. Using a keyword in your URL will help boost your relevancy on most search engines.  

 

URL's Such as a url of http://www.myhome.com/listings.htm doesn't say too much, but a url of http://www.bill.com/toasters.htm includes the keyword "toaster" in any searches. (cool eh? now that is quality web ranking design advice) (its also a tricky way of working in ranking, design, and advice to reinforce my keywords).

 

To that end, and as per the recommendation of a few bright minds in this forum, I adapted the product links on my All Products page to pass the product name as a dummy variable in the URL, remembering urlencode() to account for pesky characters.

 

With this improvement, when you point a spider to your All Products page, it will see (and index!) your links like this:

http://www.tibetcollection.com/product_info.php/name/Buddha+Travel+Altar/products_id/53

Viola! Keywords in the URL. How's it done?

 

If you're not currently using an All Products page, just install the most recent version of the contribution. It's a simple install.

 

If you want to upgrade, either just replace catalog/allprods.php with the new version or find and replace the following in catalog/allprods.php:

 

Replace:

echo "     <a href="" . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $this_products_id . (($this_language_code == DEFAULT_LANGUAGE) ? '' : ('&language=' . $this_language_code)), 'NONSSL', false) . "">" . $this_products_name . "</a><br>n";

With:

echo "     <a href="" . tep_href_link(FILENAME_PRODUCT_INFO, 'name=' .urlencode($this_products_name). '&products_id=' . $this_products_id . (($this_language_code == DEFAULT_LANGUAGE) ? '' : ('&language=' . $this_language_code)), 'NONSSL', false) . "">" . $this_products_name . "</a><br>n";

 

When you've finished, each page on your site should link to the AllProds.php page. AllProds, in turn, links to each of your products, now with a URL packed with tasty keywords. Just Ask Google and others to index yourdomain.com/allprods.php.

 

On my site, I have taken it one step further, including similar calls in virtually all of my product and category links.

 

To initiate globally, you'll have to touch every file that contains a product link. As an example, let's look at the What's New infobox.

 

In includes/boxes/whats_new.php, find:

'text'  => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><b><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id'], 'NONSSL') . '">' . $random_product['products_name'] . '</a></b><br>' . $whats_new_price

And replace with:

'text'  => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'name=' .urlencode($random_product['products_name']). '&products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><b><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'name=' .urlencode($random_product['products_name']). '&products_id=' . $random_product['products_id'], 'NONSSL') . '">' . $random_product['products_name'] . '</a></b><br>' . $whats_new_price

 

Look specifically at what we're doing to the href:

tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product['products_id'])

tep_href_link(FILENAME_PRODUCT_INFO, 'name=' .urlencode($random_product['products_name']). '&products_id=' . $random_product['products_id'])

 

Enjoy.

 

- Greg

Share this post


Link to post
Share on other sites

Great mod.

 

But it doesnt work on all links.

 

I have 4 links it says are broken.

The only factor they have in common is they all begin with the number '1'

 

Any ideas?

 

CC.

Share this post


Link to post
Share on other sites

PM'd to you to save on spam.

 

CC.

Share this post


Link to post
Share on other sites

it's not that the product names begin with '1', it's that they contain a '/'

 

It looks like only a few (13?) of your products contain that character in their name. try using / instead?

 

If anyone can think of a better fix, please letr me know. I guess urlencode() doesn't take care of '/'??

 

- Greg

Share this post


Link to post
Share on other sites

Ok, well in that case the best solution is going to be to turn off search engine URL's...

 

I have these on as I find it has always helped me in search results.

 

But that makes a difference is this will outway that benefit.

 

If I turn off friendly URL's then it is fine.

 

CC.

Share this post


Link to post
Share on other sites

Hmmm...

 

The only biatch about that tho, is we list top in the UK for one very popular PC case at the moment, and set friendly URL's back to false all my listed links dont work... Arse!

 

It appears it might be too late for me to change to this or we are likely to have one hit wonders on our site, who leave as soon as the get product not found.

 

:?

Share this post


Link to post
Share on other sites

If you think your results are because of the Search Engine Safe URLs, don't turn them off!

 

Just change the product names in question so that a name looks like this:

120GB Maxtor DMax+9 133/7200

looks like this:

120GB Maxtor DMax+9 133/7200

 

That's the only change you should have to make. It looks like you'll only have to change 12 products and it will remain transparent to the user.

 

- Greg

Share this post


Link to post
Share on other sites

k, i'll give it a go.

 

Will have to tell all the guys who add products to the site also.

Can just see their faces now when I tell them to add / instead of /

 

:D

Share this post


Link to post
Share on other sites

here ya go:

 

 'text'  => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'name=' . str_replace("/", "/", urlencode($random_product['products_name'])) . '&products_id=' . $random_product['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><b><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'name=' .urlencode($random_product['products_name']). '&products_id=' . $random_product['products_id'], 'NONSSL') . '">' . $random_product['products_name'] . '</a></b><br>' . $whats_new_price

 

just changed

urlencode($random_product['products_name'])

to

str_replace("/", "/", urlencode($random_product['products_name']))


The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Share this post


Link to post
Share on other sites

Hi, I have just updated the allprods and I thank you all

 

one question though.

 

4. Add this hidden link to where ever you like it i placed it in the catalog/includes/Header.php but you can also place it in footer or whereecer you want too :-)

 

How do I add a hidden link? how should it be?

 

Thanks

Salvo

Share this post


Link to post
Share on other sites

Sorry about the confusion. May be time to revist the install file, too.

 

All Products isn't really meant as a navigation tool for users. It's specifically designed for spiders, essentially providing a 2-click link between every one of your products.

 

Your link to allprods.php doesn't have to be visible to users. You can hide the link by placing the href around a transparent gif rather than linking text or a visible image. This way, the spiders will see the link and follow it, while most users won't see anything...

 

Really, this doesn't matter. I personally link to allprods.php through a very visible text link in my categories box... Your only concern is that a spider will be able to find a link to allprods.php from every page.

 

- Greg

Share this post


Link to post
Share on other sites

I have 100's of "/" in my product names as I use C/S as an abbreviation for Cut and sifted in describing herbs. If I can avoid changing all of them I'd be eager to hear about it!

Share this post


Link to post
Share on other sites

hey thanks for this update! good work!

 

One question though...

 

my product listed in allprods.php now comes up as:

 

http://www.redinstead.com.au/product_info..../products_id/28

 

in the URL. I know that the %20 stands for a space - is this okay (the right format) for the Search Engines?

 

thanks

 

Jen


I haven't lost my mind - I have it backed up on disk somewhere.

Share this post


Link to post
Share on other sites

I personally don't like either of the urlencode functions for this purpose...

 

I like replacing the space with an underscore alot better

 

I much prefer:

my_product_name_here

 

to

my+product+name+here

 

or

my%20product%20name%20here


The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Share this post


Link to post
Share on other sites
I personally don't like either of the urlencode functions for this purpose...  

 

I like replacing the space with an underscore alot better  

 

I much prefer:  

my_product_name_here  

 

to  

my+product+name+here  

 

or  

my%20product%20name%20here

 

 

Firstly, do all of the 3 ways (underscore, plus and space) work for Search Engines equally?

 

Secondly, how would I change the space to an underscore or plus?

 

thanks

 

Jen


I haven't lost my mind - I have it backed up on disk somewhere.

Share this post


Link to post
Share on other sites

Just tried to down load this contribution, get the message, not found on this server :cry:

 

Somebody had the same problem?


Besser heute als morgen......

Share this post


Link to post
Share on other sites
Firstly, do all of the 3 ways (underscore, plus and space) work for Search Engines equally?

I don't know. Time will tell, unless someone knows.

Search engines change the way they handle things every time...

 

Secondly, how would I change the space to an underscore or plus?

 

www.php.net/ereg_replace

 

ereg_replace(" ", "_", $string);

 

Mattice


"Politics is the art of preventing people from taking part in affairs which properly concern them"

Share this post


Link to post
Share on other sites

hello

 

i want to recomand an addon to All Products.

when you list the products in one page to create some tables with titles of the category in wich that products are.so the client should know that a certain product that is listed is included in *that* category.

 

zam

ps:sorry for my poor english


Serban Ghita - my blog

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×