I searched, but can't fix my SEO Problem

I searched and searched through the forum but couldn’t find the answer to my SEO problem.



I added some new categories today. My first category was called



T5 High Output Lighting



and was a sub-category of



Lighting



and worked great. I then added a sub-category to the T5 lighting and this is what I ended up with:



36-inch-1-2-3-4-5



This is the total URL:



[URL=“http://www.saltwatertogo.com/lighting/t5-high-output-lighting/36-inch-1-2-3-4-5/”]http://www.saltwatertogo.com/lighting/t5-high-output-lighting/36-inch-1-2-3-4-5/[/URL]



Can anyone help me? I would really appreciate it.



Brandon

The easiest way to create better urls is to remove them from the database using PHPMyAdmin and let them auto-create themselves from the product title.



Obviously you’ll lose google rankings a bit, but your site will get the benefit of being “fresh” to an extent if you remove hte generic 1-2-3-4-5 urls.



J

Yeah that would work, but why did this all of a sudden happen and why did it only happen with 3 out of the 4 new categories I added today?



The SEO addon worked fine for the first category, but the following three didn’t. The SEO addon also worked just fine for the new products I added today.



Also when I go to manually change the SEO name for the category I can’t. Why would it not allow me?



Brandon

Are you going to write a book of secrets…lol

[quote name=‘brandonvd’]Yeah that would work, but why did this all of a sudden happen and why did it only happen with 3 out of the 4 new categories I added today?



The SEO addon worked fine for the first category, but the following three didn’t. The SEO addon also worked just fine for the new products I added today.



Also when I go to manually change the SEO name for the category I can’t. Why would it not allow me?



Brandon[/quote]



The main reason I could think of this happening that you’ve got more than one category with the seo name “36” as you’ve got the " in the product title it might have an effect on the SEO rewrite to ACSII.



If anything I suggest that you change the product title to “36 inch” and delete the seo url and see what it creates.



J

[quote]Very nice ( and fast ) site Brandon.[/quote]



Thank you for the compliment. I haven’t done anything special. The only thing I can take credit for is I feel I chose the right host when I decided to go with CyberLNC.



Jesse



I think you are on to something. When I changed the category name the SEO worked perfect. I actually have 6 categories in various places named 36 Inches and I guess I never noticed the numbers being added on.



As for the products with the quotes, the SEO addon actually just ignores the quotes and assigns the SEO name just fine.



Is there any way to have the SEO addon assign different names for each category that has the same name like 36 Inch? If not than I guess I just need to go through and give new category names.



Thank you for your help,



Brandon

We have just applied this piece of code (in red) in the file addons/seo/func.php. It isn’t fully tested yet, but It should be helpful…

When you apply this code you’ll need to clean the cscart_seo_names table in order to allow SEO to recreate links.


[QUOTE]function fn_create_seo_name($object_id, $object_type, $object_name, $index = 0)

{

global $db_tables;



$_object_name = preg_replace(“/[^-_a-zA-Z0-9]?/”, “”, fn_generate_name($object_name));

if (empty($_object_name)) {

$__name = fn_get_seo_vars($object_type);

$_object_name = $__name[‘description’] . ‘-’ . $object_id;

}



$exist = db_get_field(“SELECT name FROM $db_tables[seo_names] WHERE name=‘$_object_name’ AND (object_id<>‘$object_id’ OR type<>‘$object_type’)”);

if (!$exist) {

$_data = array(

‘name’ => $_object_name,

‘type’ => $object_type,

‘object_id’ => $object_id

);

db_insert_by_array($db_tables[‘seo_names’], $_data, true);

} else {

[COLOR=“Red”] /* __CUSTOM http://www.itsoluzioniglobali.it /

if (substr($object_name, strlen($object_name)-strlen(CS_SEO_DELIMITER . $index)) == CS_SEO_DELIMITER . $index) {

$object_name = substr($object_name, 0, strlen($object_name)-strlen(CS_SEO_DELIMITER . $index));

}

/
__CUSTOM http://www.itsoluzioniglobali.it */[/COLOR]



$index ++;

fn_create_seo_name($object_id, $object_type, $object_name .CS_SEO_DELIMITER. $index, $index);

}



return $_object_name;

}[/QUOTE]



Bye

IT Soluzioni Globali

http://www.itsoluzioniglobali.it

Thank you for the code.



Your code kind of fixed the problem. Now instead of saying:



48-Inch-1-2-3-4-5.html



It now just says:



48-Inch-1.html



Thank you very much for this.



Brandon

We’re using 2.0.8.



Could we use the same additional code?



Cheers

Red