Jump to content
spidometrs

[CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

Recommended Posts

I don't know what the problem might be. All I can say is that I've installed this addon into many shops without any problems.  Try setting all of the settings for it to false, except for the first one to see if that makes a difference. If not, the problem is beyond something I can fix in a support thread.

Share this post


Link to post
Share on other sites
13 hours ago, vampirehunter said:

i did error log check and it says this


PHP Warning:  mysql_fetch_array() expects parameter 2 to be long, string given in /home/test/mysite.com/store/includes/functions/database.php on line 225

@vampirehunter I recommend that you try to get the mysqli extension enabled for your installation. mysql is deprecated even on php 5.6 and not available on php7. It's possible that there are bits of code that don't work properly on this old extension.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
54 minutes ago, BrockleyJohn said:

@vampirehunter I recommend that you try to get the mysqli extension enabled for your installation. mysql is deprecated even on php 5.6 and not available on php7. It's possible that there are bits of code that don't work properly on this old extension.

how is this enabled on web hosting?

does the webhost have to do it?
or can it be done in cpanel?

 

Share this post


Link to post
Share on other sites
1 hour ago, BrockleyJohn said:

@vampirehunter I recommend that you try to get the mysqli extension enabled for your installation. mysql is deprecated even on php 5.6 and not available on php7. It's possible that there are bits of code that don't work properly on this old extension.

i installed the latest 2.2 seo urls on an edge installation and im getting that php error in error log.

neither the category or product names are showing in the urls, just the product ids and category ids

been through the installlation step by step multiple times so not sure why its not working

 

 

Share this post


Link to post
Share on other sites
5 minutes ago, vampirehunter said:

how is this enabled on web hosting?

does the webhost have to do it?
or can it be done in cpanel?

 

On shared hosting, it's usually implicit in your choice of php version. You'll likely need the host's help to get the right php.ini file set up. First, use the Server Info option in admin/tools and search for mysqli. If you have a section with that heading, the extension is enabled and there's an issue with the code somewhere. If you don't have that section, speak to your webhosts and if you need more help from us on here, start a separate thread because in that case it's not an SEO Urls issue


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
8 minutes ago, BrockleyJohn said:

On shared hosting, it's usually implicit in your choice of php version. You'll likely need the host's help to get the right php.ini file set up. First, use the Server Info option in admin/tools and search for mysqli. If you have a section with that heading, the extension is enabled and there's an issue with the code somewhere. If you don't have that section, speak to your webhosts and if you need more help from us on here, start a separate thread because in that case it's not an SEO Urls issue

Hi, that was it!

i enabled mysqli in cpanel via php selector and it worked straight away

cheers

 

Share this post


Link to post
Share on other sites

I have installed this module back in January and everything works fine.

Last week I noticed a strange BUG that I couldn't yet find a solution to, and I would appreciate if someone can give me a hint. 

 

Basically, if the product name contains the word "by" (i.e. Good Product by Our company) then the script returns an error. In other words, the URL that is being generated will be something similar to this:

https://www.-...-.com/good-product-by-our-company-p-23.html

which returns an error:

Not Found
The requested URL /all-products.php was not found on this server.

Then if I remove the phrase "-by-" or change it in any way (i.e. replacing it with "-by_-") then the error goes away.

So somehow the presence of the "-by-" phrase sends a request for the URL /all-products.php, which is not found on the server.

Thanks in advance.

Share this post


Link to post
Share on other sites
6 hours ago, edo.script said:

Then if I remove the phrase "-by-" or change it in any way (i.e. replacing it with "-by_-") then the error goes away. 

So somehow the presence of the "-by-" phrase sends a request for the URL /all-products.php, which is not found on the server.

This addon uses certain characters to identify the page. For example, -p- is a product page and -c- is a category page. The -by- is used to identify All Product pages. So when that is used in the url, the code thinks it is a link to an All Products page and tries to create the url for it, which is invalid.

The word by is not useful for SEO and will be ignored by the search engines. If you want it for your customers, you would have to change the code in this addon to use a different identifier.

Share this post


Link to post
Share on other sites
7 hours ago, Jack_mcs said:

This addon uses certain characters to identify the page. For example, -p- is a product page and -c- is a category page. The -by- is used to identify All Product pages. So when that is used in the url, the code thinks it is a link to an All Products page and tries to create the url for it, which is invalid.

The word by is not useful for SEO and will be ignored by the search engines. If you want it for your customers, you would have to change the code in this addon to use a different identifier.

That makes sense and I was guessing that it has to be a kind of a key phrase. Then I guess I would simply get rid of it.

Thanks.

Share this post


Link to post
Share on other sites
7 hours ago, Jack_mcs said:

This addon uses certain characters to identify the page. For example, -p- is a product page and -c- is a category page. The -by- is used to identify All Product pages. So when that is used in the url, the code thinks it is a link to an All Products page and tries to create the url for it, which is invalid.

The word by is not useful for SEO and will be ignored by the search engines. If you want it for your customers, you would have to change the code in this addon to use a different identifier.

I saw the RewriteRules (-by-, -au-, -links-, etc.) in the .htaccess file.

Wouldn't it be a better idea to check for these key-phrases within the product name and remove them before the SEO link is generated?

I took a quick look and couldn't find the code where the str_replace(" ", "-",... command is executed for product names. if you can point it out to me that would be helpful.

Thanks!

Share this post


Link to post
Share on other sites
Posted (edited)
25 minutes ago, edo.script said:

I saw the RewriteRules (-by-, -au-, -links-, etc.) in the .htaccess file.

Wouldn't it be a better idea to check for these key-phrases within the product name and remove them before the SEO link is generated?

I took a quick look and couldn't find the code where the str_replace(" ", "-",... command is executed for product names. if you can point it out to me that would be helpful.

Thanks!

If there are no other reasons why we shouldn't, maybe within

                               function get_product_name($pID){

right after line:

                                $pName = $this->strip( $result['pName'] );

we can add something like:

                                $pName = str_replace("-p-", "-", $pName);
                                $pName = str_replace("-c-", "-", $pName);
                                $pName = str_replace("-m-", "-", $pName);
                                $pName = str_replace("-pi-", "-", $pName);
                                $pName = str_replace("-by-", "-", $pName);
                                ......
                                $pName = str_replace("-fra-", "-", $pName);
                                $pName = str_replace("-i-", "-", $pName);
                                $pName = str_replace("-links-", "-", $pName);
                                ................

which would remove the phrases that have no SEO benefits yet may interfere with the SEO functionality. 

Thanks!

Edited by edo.script

Share this post


Link to post
Share on other sites
Posted (edited)

You could use the short word filter and set it to 2:

Filter Short Words
This setting will filter words less than or equal to the value from the URL.

or use the character conversion list:

Enter special character conversions
This setting will convert characters.

The format MUST be in the form: char=>conv,char2=>conv2

This allows to remove concrete expressions like: by=>[leave empty]

 

Don't forget to reset the SEO cache after changing any of these settings 😉

Edited by raiwa

Share this post


Link to post
Share on other sites
12 minutes ago, raiwa said:

You could use the short word filter and set it to 2:

Filter Short Words
This setting will filter words less than or equal to the value from the URL.

or use the character conversion list:

Enter special character conversions
This setting will convert characters.

The format MUST be in the form: char=>conv,char2=>conv2

This allows to remove concrete expressions like: by=>[leave empty]

Much better idea. Thank you for bringing this up. My short words was on 1, which i changed to 2.

As far as the character conversion, I see  it is Case SeNSitive. So we would need to have (By=>, BY=>, by=> ) to make sure it serves the purpose.

Thanks.

Share this post


Link to post
Share on other sites

Hi there using this great contribution

oscom-ultimate-seo-urls latest version

sorry if I am in the wrong spot

 

somehow Google has found a url    https://www.mysite.com.au/index.php?cpath=50  note the lower case p in cpath instead of P. This has never been a url on my site

No idea where this URL came from but google is insisting it is an error and if this link is followed it  creates a redirect loop . I have tried to 301 redirect it to the correct place which is

https://www.mysite.com.au/kaleidoscopes-c-50.html

but i cannot for the life of me get it to redirect.

 

The correct version with the proper cPath redirects correctly

Just wondered if you have an suggestions

Share this post


Link to post
Share on other sites

as suggested by Jack I have searched for cpath as opposed to cPath in my files. I can find instances of cpath in the 

includes/classes/category_tree.php

however checking the latest version they are all cpath is that correct?

Share this post


Link to post
Share on other sites

The uses of cpath in that file are for variables. The actual url parameter uses cPath. I didn't scour the whole file but it doesn't appear that there is a problem with that file.

Share this post


Link to post
Share on other sites

you should remove the htaccess redirect until you're sure of the code, because you can't do a simple redirect with the query string parameter.

It's possible that there's an external link to that URL, that might be how google discovered it.

You should examine that URL with the google inspection tool to see what further information there might be.

I have checked your site, and does not appear that you are linking to that URL anywhere.

 

Share this post


Link to post
Share on other sites

Thank you @Hotclutch @Jack_mcsfor your time

I have searched all files and there is no cpath apart from what i mentioned above which is not relevant

The search tool says ...

referring page
None detected
URL might be known from other sources that are currently not reported
search anomaly 
I am not trying to redirect it and have removed code as it didn't work anyway.
Why does the incorrectly formed cpath go into a loop and not just to a 404 not found?
 

 

Share this post


Link to post
Share on other sites

hmm just goes round and round until it fails.

@Jack_mcs should a non existent url go to a 404 

It looks like the redirect for the correctly formed cPath  is somehow catching the cpath and stopping it going to a 404.

 

 

Share this post


Link to post
Share on other sites

also just checked for my interest

dpath  will redirect home

npath will redirect to home

lpath goes round and round

is the htaccess code case sensitive?

Share this post


Link to post
Share on other sites

Happens on other sites with this addon. In the meantime, don't add anything to htaccess while you wait for reply.

Share this post


Link to post
Share on other sites
1 hour ago, douglaswalker said:

should a non existent url go to a 404 

The short answer is no. The code just redirects to the given page. Once on that page, if it doesn't exist then it should show not found. But  oscommerce doesn't return 404's. It might show a 404 on the page but the actual header status is different. That's why I wrote the https://apps.oscommerce.com/znMRO. Though I'm not sure that will help with your problem. Try turning this addon off to see if it makes a difference.  

Share this post


Link to post
Share on other sites
7 hours ago, Jack_mcs said:

The short answer is no. The code just redirects to the given page. Once on that page, if it doesn't exist then it should show not found. But  oscommerce doesn't return 404's. It might show a 404 on the page but the actual header status is different. That's why I wrote the https://apps.oscommerce.com/znMRO. Though I'm not sure that will help with your problem. Try turning this addon off to see if it makes a difference.  

I have your header Status Handler installed.

So I tried turning off SEO and accessing 

https://www.mysite.com.au/index.php?cpath=50   .... redirects to index with no issue .. so that seems to show that the .htaccess is ok?

But with SEO on it just loops and times out.

It is the only URL that this issue is being reported on.. so not a huge issue but i would love to get to the bottom of it.. or find away to redirect the incorrect and non existent URL.

 

I also tested with just Header Status handler off as well... that made no difference

Share this post


Link to post
Share on other sites
5 hours ago, douglaswalker said:

I have your header Status Handler installed.

So I tried turning off SEO and accessing 

https://www.mysite.com.au/index.php?cpath=50   .... redirects to index with no issue .. so that seems to show that the .htaccess is ok?

But with SEO on it just loops and times out.

It is the only URL that this issue is being reported on.. so not a huge issue but i would love to get to the bottom of it.. or find away to redirect the incorrect and non existent URL.

 

I also tested with just Header Status handler off as well... that made no difference

This problem can be replicated with all your category URLs at least. It may only be the one that is reported, but the question is how did google come to discover it. Did you search the addon files for the occurrence of cpath?

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

×