Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Recommended Posts

@artfulweb The error occurs when something is displayed before the code but finding that can be difficult. Here are some things to check:

- Check in the includes/hooks/shop/sitewide/ and templates/default/includes/hooks/shop/sitewide/ directories to see if there are any files added by addons. There will be some files there so you need to look at the original files to see which are not added by addons. If there are others, you can try renaming this one to something like aaa_seoUrl.php. The inclusion of hook files are done alphabetically so renaming it assures it is loafed before the others. As far as I know this only applies but directory but it might be better to search all of the includes/hooks/shop/ files (and the one in templates) for the startsearch code. Again, some of the stock ones will have that code. You just need to look for ones that are not stock files,

- Try to isolate the failure.  To do this, add a link, using the tep_href_link function, on a page that doesn't have one - maybe the contact us page. If the error still occurs then it is probably due to something in one of the modules. Try turning off modules, like navbar, logo and infoboxes. This is difficult for a live shop but it is a good way to elimiate potential problems. I would concentrate first on modules that were added by addons. As mentioned, the addon works for me here but that is in a test shop without any addons.

- Try enabling the developer console in your browser. Cause the error to occur and then check the path the code took to get there. Any file in the path can be the cause. If one of them has a space before the first <?php or if a file has the BOM set, it will cause this. For the BOM you will need a program or editor that can identify that. Again, I would look at files added by addons first. 

- Assuming the problem is due to an addon or your installation, the quickest way might be to create a new shop and just install this addon. If it works, which it should, then you can install the other addons you use and see if it fails at some point.

That's all I can think of for now. I hope it helps find the problem.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

13 hours ago, artfulweb said:

Found it and injectSiteStart is on line 36 of that file so why the problem? I am so perplexed.

The problem is that output has already started at line 26!

try editing to

public function listen_injectRedirects() {

instead.

Looks like there's a new hook for exactly this purpose

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

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

Link to comment
Share on other sites

Hi Jack, Hi John,

Jack, thank you but this is a vanilla install of 1.0.8.9 with only Ultimate SEO installed so there is nothing else that has been modified. Do not understand how it works on yours and not mine!

John, I am not sure in which file you think I should change the public function.

Link to comment
Share on other sites

If we look at /includes/components/template_top.php:26 line 26 is:

<!DOCTYPE html>
<html<?php echo HTML_PARAMS; ?>>

If we look at /includes/classes/seo.class.php, linse 2907-2910 are 

                        case ($this->attributes['USE_SEO_REDIRECT'] == 'true'):
                                header($_SERVER['SERVER_PROTOCOL'] . " 301 Moved Permanently");
                                $url = str_replace('&amp;', '&', $url);
                                header("Location: $url"); // redirect...bye bye                
                                break;
 

Link to comment
Share on other sites

31 minutes ago, artfulweb said:

Do not understand how it works on yours and not mine!

Same here. If you have not done so after the last file change, use the uninstall option in the settings to make sure it is not a cache issue. The change John mentioned raises the insertion point a little and may help. The edit is to the sep file that you changed previously.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

3 minutes ago, artfulweb said:

header("Location: $url"); // redirect...bye bye                
                                break;

For the above, please change to 

               header("Location: $url"); // redirect...bye bye     
               exit;
               break;

 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

4 minutes ago, Jack_mcs said:

For the above, please change to 


               header("Location: $url"); // redirect...bye bye     
               exit;
               break;

 

Changing that breaks the site, clicking a product everything under the navbar goes blank and stll throws the same error as before. No cache issue as I uninstalled and reinstalled.

Link to comment
Share on other sites

17 minutes ago, artfulweb said:

Changing that breaks the site,

It shouldn't be needed but was worth a try. What version of php are you using. I tried both 7.4.13 and 8.0.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

I'm sorry but I don't have an answer for you. If I could reproduce it here then I could look into it. But since it works for me there's not a lot I can do. There were a lot of updated between those two versions of php so I suppose they could have introduced and then fixed something that causes this, though it seems unlikely.  All I can think is that maybe some file got corrupted in the installation or maybe you are using a different 1.0.8.9 package that I used. So maybe download a fresh copy of that version and install again to see if that helps? If I can think of something else I will post here but, for now, I'm out of ideas. :(

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

@artfulwebI was just working on a different problem that reminded me of this one. That problem was a setting on the server not being set. To check it, please go to admin->Tools->Server Info and search for "output buttering". There should be a number for it. The default is 4096. It can be something different but if it is blank that is most likely the problem. 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 weeks later...
On 1/4/2022 at 8:04 PM, Jack_mcs said:

@artfulwebI was just working on a different problem that reminded me of this one. That problem was a setting on the server not being set. To check it, please go to admin->Tools->Server Info and search for "output buttering". There should be a number for it. The default is 4096. It can be something different but if it is blank that is most likely the problem. 

Hi Jack,

Sorry to take so long. I created a phpinfo file to se the output_buffering (can not see all server details through the admin panel) and as it was 0 I added it to my php.ini file with the default 4096 as you stated but still no change. Ultimate SEO URL worked before on the server apparently with the buffering at 0 so that should not have been the problem but thanks anyway.

Link to comment
Share on other sites

@artfulwebPlease try changing this

$string = iconv('UTF-8', 'ASCII//TRANSLIT', $string);

to this

$string = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $string);

 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Then I'm out of ideas, again. :( Although I should mention that you may need to uninstall it via the setting to make sure the changes take. Those two changes were due to problems I found while installing into shops. Maybe something else will come up.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

 

@Jack_mcs, do you think you might be able to fix that issue for @artfulweb if you had access to the code so that you could see it and test it? Perhaps for a fee?

There's so much more value to actually being able to see the code and work with it, rather than guessing at a solution.

 

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&amp;geo=US&amp;q=oscommerce

Link to comment
Share on other sites

Thanks @DemitryYes, for those that don't know I do work on any oscommerce problems. Anyone that is interested, please contact me.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...