Page 2 of 3

Re: SEO Urls

Posted: Thu Jun 04, 2009 9:05 am
by Daniel
liposuctionguide wrote:It is a well-known fact nowadays that without SEO a Web site stands many chances of not being indexed by search spiders, therefore risking not being ranked high enough (or even at all) in the SERPs. The result: poor conversion rate.

This situation is quite easy to avoid by performing some "cosmetic" operations on a site. One of these operations, considered by some rather difficult and a bit time-consuming, but quite effective in the long run by others, is URL rewriting.

Depends on the type of SEO. Content has a better effect than messing with SEO URL's.

Re: SEO Urls

Posted: Sat Jul 04, 2009 1:25 am
by stedmanproductions
Just installed 1.2.9 and enabled SEO urls. Nothing seems to happen. Am I missing something?
Also, when I change the theme, it still show the default skin. Any idea why?
And last, when I enable the UPS shipping method, i get "UPS class not found" when I checkout.

Thanks! Great job by the way. Love OpenCart.

Re: SEO Urls

Posted: Fri May 21, 2010 1:56 am
by mancourt
Bump... Has this still not been integrated? Just moved from Prestashop due to a slew of issues... hoping I made the right decision :-\

Re: SEO Urls

Posted: Fri May 21, 2010 3:08 am
by Qphoria
There are many other posts on the topic. This has been working since 1.2.9 and we are now on 1.4.7. Enable it in the admin, if using a subdirectory for your shop then add that to the htaccess.txt file and change the name to .htaccess

Re: SEO Urls

Posted: Fri May 21, 2010 6:12 am
by benjamin
Qphoria wrote:There are many other posts on the topic. This has been working since 1.2.9 and we are now on 1.4.7. Enable it in the admin, if using a subdirectory for your shop then add that to the htaccess.txt file and change the name to .htaccess
While the field for the seo urls is currently named "SEO Keyword:", is this used for anything else than the seo urls? If not, what do you think about renaming it to "SEO URL"?
Furthermore, their is no check for uniqueness. It would be nice to have this to prevent any problems if someone used the same input twice.

Anyway to support you working on the core?

Re: SEO Urls

Posted: Mon May 24, 2010 7:59 pm
by jcybarns
There are many other methods to have this implemented in an effective way, but the thing that matters is what results you are looking for and thus the method to be adopted is to be decided accordingly. Now, what Benjamin says is quite to the point about the situation as you should have different results for both of them and it would be a good technique to include this in your work.

Re: SEO Urls

Posted: Tue Jul 13, 2010 3:41 am
by cbishwaraj
SEO url is working .
Now its appearing as from Meta-Keyword.

Isn't it possible to have just the http://www.domain.com/catagories_name/Product_name.html ????

How can i do that ?

and where should edit the file or change the settings for this ?


Can anybody suggest, Please ?

Thank you.
John

Re: SEO Urls

Posted: Tue Jul 13, 2010 4:22 am
by Xsecrets
not sure what you are saying if you set category_name as the seo keyword in your category and product_name.html as your seo keyword in your product you should get a url as you described.

Re: SEO Urls

Posted: Wed Jul 28, 2010 1:37 pm
by cristinamartine
You can rewrite the urls in the .htaccess file if you have mod-rewrite installed in your server. If your host is using apache servers, then mod-rewrite should be installed and all you need to do is google how to rewrite urls in .htaccess.

Re: SEO Urls

Posted: Wed Jul 28, 2010 9:18 pm
by JNeuhoff
Xsecrets wrote:not sure what you are saying if you set category_name as the seo keyword in your category and product_name.html as your seo keyword in your product you should get a url as you described.
I think in Opencart the SEO keywords have to be unique across all the categories, products, and information pages. E.g. if a product has the SEO keyword 'table', don't use 'table' for any other product's and category's SEO keyword.

Re: SEO Urls

Posted: Wed Jul 28, 2010 11:12 pm
by mayor21
hi, i'm a noob. just recently setup an onlineshop. so far i think opencart is one of the best. bravo open cart!
regarding SEO url, i was initially totally clueless. after doing some search, now i understand maybe not in depth, but i got the idea what is seo url and why is it quite important.

after reading posts especially this topic posts, i am able to create so called SEO url. i would like to thank everyone who are willing to share knowledge and experience. thank you again.

Re: SEO Urls

Posted: Thu Aug 26, 2010 5:16 pm
by andrathms
You are absolutely right about that and I do think that the SEO URL's are one of the most important factors that would help us to achieve the desired results. Though, it is not too hard to be understood, what is more difficult is to have it implemented in an appropriate manner. It feels good to be associated with such a place where there is sharing of good quality information about SEO.

Re: SEO Urls

Posted: Wed Nov 03, 2010 10:27 am
by jgjh151
As I was working in the admin area, in particular, the SEO Keywords section, I noticed that what I enter in this box is placed at the end of the url. For most people, keyword means it will be placed into the keyword meta tag. Maybe "SEO Keyword:" should be "SEF URL:" which means search engine friendly URL...to help avoid some confusion. Just a thought, other than that, we pretty much have the options to do it all in the admin area, enter meta keywords, description and custom URL.

One issue I found was that you can still enter the same "SEO Keyword:" for multiple products and they all go to the same product. This could be an issue for shops with lots of products. A check in the background could help avoid this. Or maybe automatically add the product ID before the "SEO Keyword:" such as "http://www.mydomain.com/34/my-product". Or remove "SEO Keyword:" all together and just use the product title to make the url. Seriously though, this is a minor issue and if it arises, it's pretty easy to spot what the issue is.

So far from what I've seen, this is one of the best carts out there.

Re: SEO Urls

Posted: Wed Nov 03, 2010 6:51 pm
by JNeuhoff
Hi jgjh151 ,

Indeed, SEO keywords in Opencart have to be unique for each product, information page, or category entry, otherwise it routes to the wrong page.

I think the best solution would be to enforce this uniqueness of keywords via the admin backend, e.g. in the product, category, or information edit pages. I have done it for several Opencart-based projects where there are are large number of products and categories.

Maybe Qphoria or Daniel could put it on their to-do list, because this is really somethign which needs to be addressed.

Re: SEO Urls

Posted: Sat Dec 04, 2010 8:43 am
by urecheatu007
JNeuhoff wrote:Hi jgjh151 ,

Indeed, SEO keywords in Opencart have to be unique for each product, information page, or category entry, otherwise it routes to the wrong page.

I think the best solution would be to enforce this uniqueness of keywords via the admin backend, e.g. in the product, category, or information edit pages. I have done it for several Opencart-based projects where there are are large number of products and categories.
You could try setting an unique index in the url_alias table for the keyword field. That would enforce uniqueness at the database layer, and would never let you save a product with a duplicate url seo keyword key

Re: SEO Urls[SOLVED]

Posted: Thu Feb 03, 2011 11:41 pm
by whitelogicsolutions
Hi guys,

I have implemented a function to handle the SEO Keyword even if you havent put in the field.
It also take care of existing keywords, as if two product have same SEO keyword in Opencart, it'll mess up all the urls.
So please feel free to comment/suggest/modify:

Showing for Product can be added to Category and Manufacturers as well

STEP1: Open admin/model/catalog/product.php
in function addProduct($data)
Find this:

Code: Select all

if ($data['keyword']) {
			$this->db->query("INSERT INTO " . DB_PREFIX . "url_alias SET query = 'product_id=" . (int)$product_id . "', keyword = '" . $this->db->escape($data['keyword']) . "'");
		}
at around line 83

Replace it to:

Code: Select all

if ($data['keyword']) {
			$this->db->query("INSERT INTO " . DB_PREFIX . "url_alias SET query = 'product_id=" . (int)$product_id . "', keyword = '" . $this->checkExistKeywords($data['keyword']) . "'");
		}else{
				$data['keyword'] = str_replace(' ','-',$data['product_description'][1]['name']);
				$this->db->query("INSERT INTO " . DB_PREFIX . "url_alias SET query = 'product_id=" . (int)$product_id . "', keyword = '" . $this->checkExistKeywords($data['keyword']) . "'");
		}
Do samething for function editProduct($product_id,$data) at around line 203

STEP2: ok we have changed the base code, now need to create a function which we have added to the above lines

Code: Select all

public function checkExistKeywords($keyword,$counter=1){
			$sql = "SELECT keyword from " . DB_PREFIX . "url_alias WHERE `keyword` = '" . $keyword . "'"; 
			$query = $this->db->query($sql);
			$result = $query->num_rows;
			if($result){
				$key_split = explode('-',$keyword);
				$key_split_count = count($key_split);
				if(is_numeric($key_split[$key_split_count-1])){
					$keyword = str_replace('-'.$key_split[$key_split_count-1],'-'.($result+$counter),$keyword); 
					$keyword = $this->checkExistKeywords($keyword,$result+$counter);
				}else{
					$keyword = $keyword.'-'.($result+$counter);
					$keyword = $this->checkExistKeywords($keyword,$result+1);
				}	
			}
			return $keyword;
		}
This function check wheather the keyword entered or created does exist or not, if do then change it's name to something like: keyword-1, it'll recurssively check for each keyword existence in the database and when it gets unique then only it'll return it.

Please let me know if some one has better way to do it.

Thanks
Ash

Re: SEO Urls

Posted: Fri Feb 04, 2011 12:34 am
by Qphoria
a few people have done something similar... probably a good idea to add to core

Re: SEO Urls

Posted: Fri Feb 04, 2011 12:56 am
by peteVA
As an example, I sell 27 varieties of MP4s.

If I am only allowed to use MP4 one time, I've got 26 wasted pages.

Here is one SEO "keyword - Blue_4th_Gen_Unbranded_nano_Style_MP4_Player_2GB_Memory_Free_Dropshipping_China_Factory_Wholesale_Prices

Here is another -
Factory_Direct_Wholesaler_Dropship_Unbranded_nano_style_Black_4th_gen_MP4_Player_Free_Shipping

And another -
Unbranded_Purple_MP4_2GB_Memory_Free_Dropshipping_China_Factory_Wholesale_Prices

I'll say it takes a long time having to not only make each of these SEO keywords, but the meta keywords and descriptions all different, let alone different names for 6 or so images per item. Such as -

mp4_player_pur_frt_wholesale_nano_style_unbranded-500x500.jpg

Hours involved in this, but hopefully it pays off.

It would also be nice to be able to have ALT Tags for all images, one more method to draw the SE's. Some carts do have this capability.

Re: SEO Urls

Posted: Thu Apr 07, 2011 10:57 am
by WebDev22
We just installed OpenCart for the first time using QuickInstall and are trying to enable the SEO URLs feature. Before diving into any code, is it safe now to assume the feature will work merely by enabling "Use SEO URLs"?

Re: SEO Urls

Posted: Thu Apr 07, 2011 8:26 pm
by grgr
As a simple quick work around I just changed line 84 of admin/model/catalog/product.php

to this:

Code: Select all

			$this->db->query("INSERT INTO " . DB_PREFIX . "url_alias SET query = 'product_id=" . (int)$product_id . "', keyword = '" . $this->db->escape($data['keyword']) . '-p-' . (int)$product_id . '.html' . "'");

which automatically adds the product ID and therefore makes the URL unique.

Obviously only works when adding a new product.