Jump to content
Sign in to follow this  
enigma1

[Contribution] SEO-G

Recommended Posts

Hi there thanks for the reply. Looking at this mod a little closer...this thing is the real deal. This thing is in its own league compared to CRE SEOs and Ultimate SEO's. To be able to tell the system exactly the way you want to rewrite a certain product...that is marvelous. It is extremely flexible it seems. I'd love to try it out. I am currently using ultimate seo's. I took your comment about established stores not switching because of seo etc.. Let me ask you this..how much flexability is there in category rewrites? Here is an example of a product and category rewrite on my site using ultimate seo... Will I be able to set up seo-g to rewrite the same way? that way I wouldn't have to have all new links? I'd love to try it out..mainly for the fleability going forward for new products etc... I am running CRE loaded 6.2. I think I can get it to work...are there any issues with checkout etc...?It won't break my store will it?

 

Category (this is the subcategory page so it writes the main category plus the subcat in the rewrite)

http://www.nicebykelli.com/catalog/diaper-...es-c-64_73.html

 

This is a product:

http://www.nicebykelli.com/catalog/babys-f...-bank-p-77.html

 

This adds the product number 77 to the end. The category adds the cat # 64

 

Let me know if this will rewrite or can be configured to rewrite exactyl the same way.

 

well ok, If I was in your place the first thing to do would be to create a copy of the store into your local pc. Then you can try it out safely into your local system and see what it does.

 

For the various re-writes the module includes lists of products, categories etc. names, where you can edit them quickly. Now of course you don't want to do that with many products. So you change the seo classes slightly those they insert the names to setup the defaults with the -p-"products_id" and -c-"cpath"

 

If you check the seo classes in catalog\admin\includes\classes folder each one of them has a function called "generate_name" This is where the name of an entity is created. It's different between classes because the database table in use is different. So for products say I could change the generate_name function so instead of this:

 

		$name = $names_array['products_name'];
	$name =  $this->create_safe_string($name);

 

I could do:

		$name = $names_array['products_name'] . '-p-' . $products_id;
	$name =  $this->create_safe_string($name);

havent tested anything here, but that's the theory anyways. And then you could change the scripts back once you finish with the existing products so the module will generate the full names with your new products

 

This way you don't have to spend ages updating hundreds or thousands of products to maintain name compatibility. Again you should test everything locally.

 

I will release v1.04 shortly (still testing), which will include a couple of fixes, as well as a safe mode of operation where the user can select if the links should be generated only for known parameters (like products_id, cpath etc) or for all parameters in the store (reviews_id, action etc). So when in safe mode it should take care of some of the problems that mentioned earlier like with the ajax buy now contribution.

Edited by enigma1

Share this post


Link to post
Share on other sites
well ok, If I was in your place the first thing to do would be to create a copy of the store into your local pc. Then you can try it out safely into your local system and see what it does.

 

For the various re-writes the module includes lists of products, categories etc. names, where you can edit them quickly. Now of course you don't want to do that with many products. So you change the seo classes slightly those they insert the names to setup the defaults with the -p-"products_id" and -c-"cpath"

 

If you check the seo classes in catalog\admin\includes\classes folder each one of them has a function called "generate_name" This is where the name of an entity is created. It's different between classes because the database table in use is different. So for products say I could change the generate_name function so instead of this:

 

		$name = $names_array['products_name'];
	$name =  $this->create_safe_string($name);

 

I could do:

		$name = $names_array['products_name'] . '-p-' . $products_id;
	$name =  $this->create_safe_string($name);

havent tested anything here, but that's the theory anyways. And then you could change the scripts back once you finish with the existing products so the module will generate the full names with your new products

 

This way you don't have to spend ages updating hundreds or thousands of products to maintain name compatibility. Again you should test everything locally.

 

I will release v1.04 shortly (still testing), which will include a couple of fixes, as well as a safe mode of operation where the user can select if the links should be generated only for known parameters (like products_id, cpath etc) or for all parameters in the store (reviews_id, action etc). So when in safe mode it should take care of some of the problems that mentioned earlier like with the ajax buy now contribution.

 

Ok, sounds good. So the script actually stores the rewrite name in the database?

Share this post


Link to post
Share on other sites

Hi, this looks like a versatile mod, but I'm having a problem getting my head around it.

In a shop products are added and/or removed on a daily basis. Do you need to run the admin update each time to generate the SEO urls for newly added products ?


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites
well ok, If I was in your place the first thing to do would be to create a copy of the store into your local pc. Then you can try it out safely into your local system and see what it does.

 

For the various re-writes the module includes lists of products, categories etc. names, where you can edit them quickly. Now of course you don't want to do that with many products. So you change the seo classes slightly those they insert the names to setup the defaults with the -p-"products_id" and -c-"cpath"

 

If you check the seo classes in catalog\admin\includes\classes folder each one of them has a function called "generate_name" This is where the name of an entity is created. It's different between classes because the database table in use is different. So for products say I could change the generate_name function so instead of this:

 

		$name = $names_array['products_name'];
	$name =  $this->create_safe_string($name);

 

I could do:

		$name = $names_array['products_name'] . '-p-' . $products_id;
	$name =  $this->create_safe_string($name);

havent tested anything here, but that's the theory anyways. And then you could change the scripts back once you finish with the existing products so the module will generate the full names with your new products

 

This way you don't have to spend ages updating hundreds or thousands of products to maintain name compatibility. Again you should test everything locally.

 

I will release v1.04 shortly (still testing), which will include a couple of fixes, as well as a safe mode of operation where the user can select if the links should be generated only for known parameters (like products_id, cpath etc) or for all parameters in the store (reviews_id, action etc). So when in safe mode it should take care of some of the problems that mentioned earlier like with the ajax buy now contribution.

In the new version, can you accommodate a means for it to ignore the /admin file? I love the contribution, but I am still having problems with .php pages from within my /Admin redirecting. my structure is:

www.mysite.com

www.mysite.com/admin

so as is, it is redirecting any .php files in my /admin folder as well. Perhaps providing the option to exclude folders in the main directory, so i can have it ignore /Admin/ altogether. I wish I knew more about this stuff, but I can say what you have accomplished with this mod is outstanding! Thanks Again

Share this post


Link to post
Share on other sites
Ok, sounds good. So the script actually stores the rewrite name in the database?

yes it does, the product, categories, manufacturers and in general names are stored in the database. So you do not lose changes.

Share this post


Link to post
Share on other sites
Hi, this looks like a versatile mod, but I'm having a problem getting my head around it.

In a shop products are added and/or removed on a daily basis. Do you need to run the admin update each time to generate the SEO urls for newly added products ?

There is no automation to that respect yet but it can be added. Perhaps I could add a global button to setup all related tables with the new names. Old, non-existend parameters where links are stored will be deleted and then the root.php will do the regular 301 redirect if a link is not present (does that part).

Share this post


Link to post
Share on other sites

Thank you for your help. I followed your advice:

 

I changed the htaccess file. I updated the files that were updated in version 1.3. Unfortunately, things got a little worse! Now, when I am logged in to admin, I can't access configure or any file for that matter. Instead, I get the cookie usage error page. Any thoughts?

 

Thank you in advance,

 

Chris

Share this post


Link to post
Share on other sites
In the new version, can you accommodate a means for it to ignore the /admin file? I love the contribution, but I am still having problems with .php pages from within my /Admin redirecting. my structure is:

www.mysite.com

www.mysite.com/admin

so as is, it is redirecting any .php files in my /admin folder as well. Perhaps providing the option to exclude folders in the main directory, so i can have it ignore /Admin/ altogether. I wish I knew more about this stuff, but I can say what you have accomplished with this mod is outstanding! Thanks Again

I may have to see this as an actual link. I tried it locally few times, but I cannot replicate it.

Share this post


Link to post
Share on other sites

Ok I did the v1.04 release. It should fix a couple of issues as mentioned previously and includes a Safe Mode function.

 

For the admin issue can you try to access a valid script directly? so instead of doint

www.mysite.com/admin/

to login do:

 

www.mysite.com/admin/index.php

php scripts aren't filtered. They should go right through.

Edited by enigma1

Share this post


Link to post
Share on other sites
Ok I did the v1.04 release. It should fix a couple of issues as mentioned previously and includes a Safe Mode function.

 

For the admin issue can you try to access a valid script directly? so instead of doint

www.mysite.com/admin/

to login do:

 

www.mysite.com/admin/index.php

php scripts aren't filtered. They should go right through.

I have played around with it some.

Here are my symptoms:

If I go to a direct URL:

mysite.com/admin/index.asp

everything works fine. But on my initial login, instead of a clean link, it is giving me a link like:

http://mysite.com/admin/categories.php?selected_box=catalog&osCAdminID=b0f76b4a512a847c274bfb8d08914d5

 

This link leads to a redirection whereas the clean link version:

http://mysite.com/admin/categories.php

takes me where i want to go.

 

Not sure if this is something that can be fixed, but at least I know I can work around it for the time being.

 

Thanks Again

Share this post


Link to post
Share on other sites
I have played around with it some.

Here are my symptoms:

If I go to a direct URL:

mysite.com/admin/index.asp

everything works fine. But on my initial login, instead of a clean link, it is giving me a link like:

http://mysite.com/admin/categories.php?selected_box=catalog&osCAdminID=b0f76b4a512a847c274bfb8d08914d5

 

This link leads to a redirection whereas the clean link version:

http://mysite.com/admin/categories.php

takes me where i want to go.

 

Not sure if this is something that can be fixed, but at least I know I can work around it for the time being.

 

Thanks Again

 

 

Ok backup your catalog\admin\.htaccess file basically you can set the inheritance to none so this will override the parent's directory's settings. By default the rule's applied to the parent folder and propagates to the sub-folders. Since SEO-G can present a directory structure of the site I cannot pre-determine the folders so it will be best to mod the admin .htaccess file a bit to get around it.

 

So in catalog\admin\.htaccess add this line at the end:

RewriteOptions

 

let me know if this works for you.

Share this post


Link to post
Share on other sites
There is no automation to that respect yet but it can be added. Perhaps I could add a global button to setup all related tables with the new names. Old, non-existend parameters where links are stored will be deleted and then the root.php will do the regular 301 redirect if a link is not present (does that part).

Ideally I think this global button (function call) should be able to be triggered from the oscommerce admin application top so that this could be automated in the background, so that if you add products through the standard catalog interface, or the quick add contribution or easy populate, it all really doesn't matter how, but that each time a function is called to add any missing entries for the newly created products and/or categories or manufacturers ...

Do you think this is feasible ?


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites
Thank you for your help. I followed your advice:

 

I changed the htaccess file. I updated the files that were updated in version 1.3. Unfortunately, things got a little worse! Now, when I am logged in to admin, I can't access configure or any file for that matter. Instead, I get the cookie usage error page. Any thoughts?

 

Thank you in advance,

 

Chris

 

I reinstalled everything and it seems to work. Should I still delete the G-reports?

Share this post


Link to post
Share on other sites
I reinstalled everything and it seems to work. Should I still delete the G-reports?

yes, delete the reports after the installation of v1.04. Also to rebuild the links fast if you have an all-products page and a sitemap, use your browser and visit them. This should automatically generate the most important links for spiders. And keep it in Safe Mode (default) initially at least and see if the spiders propagate the links properly.

Share this post


Link to post
Share on other sites
Ideally I think this global button (function call) should be able to be triggered from the oscommerce admin application top so that this could be automated in the background, so that if you add products through the standard catalog interface, or the quick add contribution or easy populate, it all really doesn't matter how, but that each time a function is called to add any missing entries for the newly created products and/or categories or manufacturers ...

Do you think this is feasible ?

It's doable, there's going to be some complexity with this. For instance products names you may want to edit them because if you rely on automation you may not like the generated link. Since the operation is transparent to the administrator, I may have to include a highlight mechanism using another column for each names table to show the recently added entries.

 

Before going there however I am trying to figure out a proper mechanism to synchronize the generated links with the various name tables. Right now if you delete a product say, you have to manually go and update the seo products table. And then also remove the links for the catalog and rebuild them. So there are 2 synchoronization processes that are needed. One to synchronize the catalog products with the seo name tables as you mentioned, the other to synchronize the name tables with the generated links. Both of these they have to be created and be effective.

Share this post


Link to post
Share on other sites
Ok backup your catalog\admin\.htaccess file basically you can set the inheritance to none so this will override the parent's directory's settings. By default the rule's applied to the parent folder and propagates to the sub-folders. Since SEO-G can present a directory structure of the site I cannot pre-determine the folders so it will be best to mod the admin .htaccess file a bit to get around it.

 

So in catalog\admin\.htaccess add this line at the end:

RewriteOptions

 

let me know if this works for you.

No, still same issues with the modified admin\.htaccess

Is there anyone using the same site structure that is not having this problem?

www.mysite.com/

www.mysite.com/Admin/

Share this post


Link to post
Share on other sites
No, still same issues with the modified admin\.htaccess

Is there anyone using the same site structure that is not having this problem?

www.mysite.com/

www.mysite.com/Admin/

ok take it out, and try this:

 

RewriteEngine on 
RewriteRule admin - [L]

where it says admin is the name of the admin folder. See if this makes a difference. (again is for the admin\.htaccess)

Edited by enigma1

Share this post


Link to post
Share on other sites
ok take it out, and try this:

 

RewriteEngine on 
RewriteRule admin - [L]

where it says admin is the name of the admin folder. See if this makes a difference. (again is for the admin\.htaccess)

No difference. I am going to check to see how much hassle is involved in changing my file structure to:

www.mysite.com/Catalog/

www.mysite.com/admin/

Seems this would solve the problems.

Share this post


Link to post
Share on other sites
No difference. I am going to check to see how much hassle is involved in changing my file structure to:

www.mysite.com/Catalog/

www.mysite.com/admin/

Seems this would solve the problems.

This is strange is like your admin\.htaccess is not executed. The rule should override the one in the catalog.

Share this post


Link to post
Share on other sites
This is strange is like your admin\.htaccess is not executed. The rule should override the one in the catalog.

Not sure what is causing it, but that seems to be the case. when i go to www.mysite.com/admin/.htaccess, it is pulling up my non-admin .htaccess file. So my admin one is being ignored.

Share this post


Link to post
Share on other sites
Not sure what is causing it, but that seems to be the case. when i go to www.mysite.com/admin/.htaccess, it is pulling up my non-admin .htaccess file. So my admin one is being ignored.

 

I have the same structure as you do and I do not have this issue. Here is all that is in my admin/.htaccess file

 

AuthType Basic

 

AuthName "OS Commerce Administration"

 

AuthUserFile "/home/user/.htpasswds/admin/passwd"

 

require valid-user

Share this post


Link to post
Share on other sites

I am using the "SEO-G Inner Separator" with "/" to separate the OSC catalog listings and emulate the hiearchial folder

 

structure of a static URL, www.oscomercestore.com/categoryA/categoryB/categoryC/product.html but I have run in to a couple

 

of problems.

 

1. Separating the listings creates naming/navigation issues. Since duplicates are not allowed, names are changed causing

 

navigation problems because the URL doesn't match the menu once a name is changed. example: different items that have a

 

common name (truck), like chevy/<b>truck</b>/bumper, Ford/<b>truck</b>/windshield and Dodge/<b>truck</b>/headlamp. 2nd and

 

3rd instances of "truck" are changed to - truck2, truck3. Is there a way to keep from changing these names?

 

2. Is there a way to remove the id's from URL? --> ?osCsid=56746ac614e1ca5e271581747214b93a

Share this post


Link to post
Share on other sites
I am using the "SEO-G Inner Separator" with "/" to separate the OSC catalog listings and emulate the hiearchial folder

 

structure of a static URL, www.oscomercestore.com/categoryA/categoryB/categoryC/product.html but I have run in to a couple

 

of problems.

 

1. Separating the listings creates naming/navigation issues. Since duplicates are not allowed, names are changed causing

 

navigation problems because the URL doesn't match the menu once a name is changed. example: different items that have a

 

common name (truck), like chevy/<b>truck</b>/bumper, Ford/<b>truck</b>/windshield and Dodge/<b>truck</b>/headlamp. 2nd and

 

3rd instances of "truck" are changed to - truck2, truck3. Is there a way to keep from changing these names?

 

2. Is there a way to remove the id's from URL? --> ?osCsid=56746ac614e1ca5e271581747214b93a

 

1. The auto-increment on duplicated product or categories names is done on purpose. Because for products for instance if you go through new products or all-products or a specials page the products do not have paths appended.

while going through the categories will show like:

site.com/Ford/truck/windshield.html

site.com/Dodge/truck/windshield.html

 

going through the new products page will show

site.com/windshield.html

site.com/windshield.html

 

Now for categories I wasn't sure like with root categories for instance the same thing can be caused and so implemented the exact same thing. Now these are the defaults you can always change them and see if the links end up to be unique for categories in every case. (you can change them from the G-Controller and then hit update)

 

The code that handles this is in the seo_categories class (as well as in every class file like seo_categories.php) where you will see:

			if( !isset($tmp_array[$seo_name]) ) {
		  $tmp_array[$seo_name] = 1;
		} else {
		  $tmp_array[$seo_name]++;
		  $seo_name .= $tmp_array[$seo_name];
		}

If you comment it out you won't have the auto-increment but from my end I need to be sure generated link names are unique. So I cannot remove the default code from the regular versions. Also the update button in the G-Controller does not check for autoincremented values so the user should be able to change the names if he wants.

 

2. For the oscsid this happens if the cookies paths/domains aren't properly setup. If you're testing with your local pc, again you need valid domains/paths. See how the included example_configure.php is set.

Edited by enigma1

Share this post


Link to post
Share on other sites

I tried, in vain, to install the Ultimate SEO URLs contrib. some weeks ago. Unfortunately, it did add a URL to each product but then kept getting a 400 browser error instead of a successful link.

Eventually, having tried unsuccessfully to find an answer on the forum, I rolled back.

Today I have installed this very well documented contrib. and am getting the same problem.

The following is the bad link (SEO-G ON) :

 

http://dotlemon.com//catalog/product_boros...00fd38cc683f08a

 

This is the good one (SEO-G OFF) :

 

http://dotlemon.com//catalog/product_info....494fd522876deeb

 

Is it possible that the warning below has anything to do with it?

 

SEO-G Zones

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/dotlemon/dotlemon.com/admin/includes/functions/database.php on line 99

 

I have copied a fresh .htaccess into www.mydomain.com/catalog and modified as per instructions.

 

My other .htaccess is in www.mydomain.com/admin, but is purely to protect the admin area.

 

Any help much appreciated

Share this post


Link to post
Share on other sites
I tried, in vain, to install the Ultimate SEO URLs contrib. some weeks ago. Unfortunately, it did add a URL to each product but then kept getting a 400 browser error instead of a successful link.

Eventually, having tried unsuccessfully to find an answer on the forum, I rolled back.

Today I have installed this very well documented contrib. and am getting the same problem.

The following is the bad link (SEO-G ON) :

 

http://dotlemon.com//catalog/product_boros...00fd38cc683f08a

 

This is the good one (SEO-G OFF) :

 

http://dotlemon.com//catalog/product_info....494fd522876deeb

 

Is it possible that the warning below has anything to do with it?

 

SEO-G Zones

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/dotlemon/dotlemon.com/admin/includes/functions/database.php on line 99

 

I have copied a fresh .htaccess into www.mydomain.com/catalog and modified as per instructions.

 

My other .htaccess is in www.mydomain.com/admin, but is purely to protect the admin area.

 

Any help much appreciated

 

the warning is irrelevant. Happens if you don't tick boxes and you hit the update/delete buttons (ie you're trying to update something without selecting entries in the osc admin options for SEO-G).

 

The "bad request" problem as I understand it, is because your catalog\includes\configure.php is incorrect. There is an extra slash somewhere and that creates problems. Check the example_configure.php it can help you setting up yours.

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  

×