Jump to content
piernas

Ultimate SEO URLS rewritter for Phoenix

Recommended Posts

Posted (edited)

Addon download: https://apps.oscommerce.com/Imrlq&ultimate-seo-urls-rewritter-for-phoenix

Features

Ultimate SEO URL rewrites the standard Phoenix URLs to make them more user friendy and with multi-language support.

Products URLs can be composed with any combination of product, category, manufacturer or model names in any order. It can be changed and the old URL will redirect to the new one.

For example if you choose category/brand/model/product-name and if the uri type is path based your product url will look like:

www.mysite.com/vegetables-von-peacock-green-tomatoes-gtom-p-6.html

instead of the regular:

www.mysite.com/product_info.php?products_id=6

Multilanguage and SEO

It also adds the ability to diferentiate URLs by language, creating different URL addresses for each one, something crucial if you want your pages to be indexed correctly by browsers depending on its target language.

Stock Phoenix returns the same URI for all the language localized versions of a page. This app will make them different pages, i.e.:

  • Default language (English): www.mysite.com/green-tomatoes-p-6.html
  • Second language (Spanish): www.mysite.com/es/tomates-verdes-p-6.html
  • Third language (French): www.mysite.com/fr/tomates-vertes-p-6.html

Note default language will not include the language path (/en/, /es/, /fr/, /de/...)

Canonical and hreflang tags

The app also includes canonical and hreflang modules that adds differentiating tags to these pages. This highly improves Phoenix SEO capabilities for multi-lingual shops.

With the canonical tags Info pages will be linked to their corresponding .php file, avoiding the spiders finding duplicated content, i.e.;

www.mysite.com/info.php?pages_id=1

will become

www.mysite.com/privacy-cookie-policy-pi-1.html

and both canonicat tags on these pages will point to

www.mysite.com/privacy.php

as the default URL for the same content.

With hreflang tags each page will containg links of other localized version of itself:

  • English <link rel="alternate" hreflang="en" href="http://www.mysite.com/my-great-category-c-3.html" />
  • German <link rel="alternate" hreflang="de" href="http://www.mysite.com/de/meine-super-kategorie-c-3.html" />
  • Spanish <link rel="alternate" hreflang="es" href="http://www.mysite.com/es/mi-estupenda-categoria-c-3.html" />

Cache

It also has the ability to cache URLs, using three methods: File, SQLite or Mysql based. This will improve the page generation times by saving database queries, specially on sites with lots of products and categories or servers with low resources.

404 error page

You can personalize your "404 Not found" page. The template is located at: /templates/default/includes/pages/notfound_404.php. It will return correct 404 header unlike stock one does.

Sitemap

Included in this package is a sitemap generator compatible with multiple languages. It will generate separate sitemaps for products, categories and other pages. To generate the sitemap you must access /sitemaps/index.php directory of your website. This task can be automated if you wish.

Changelog:

R3.0.0 (December 2020)

  • Initial release for Phoenix 1.0.7.5+. Hopefully there will be no need of doing any more major changes in the app unless core code changes drastically. For earlier versions download R2.09 at https://apps.oscommerce.com/5GV7s&ultimate-seo-urls-5-pro
  • Allow to processs links outside root folder (ie. ext/directory).
  • New installation process. No core code changes or edits needed anymore.
  • New admin configuration page
  • Removed support for database language conversions (only file conversions allowed).
  • New Canonical module
  • New 404 error page with template support.
  • Support for write.php (write reviews) and info.php (editable pages) special pages included

This app is based on Ultimate SEO URLS 5 Pro for Oscommerce 2.3 by Jack_mcs (for older Oscommerce versions).

Edited by piernas

Share this post


Link to post
Share on other sites

Thank you for the great addon @piernas

 

I updated to 1.0.7.12 and installed the addon, and keep getting this error: 

Fatal error: Uncaught Error: Class 'usu_Main' not found in /home/XXXXX/XXXXXt/includes/classes/usu_init.php:16 Stack trace: #0 /home/XXXXX/XXXXX/includes/system/versioned/1.0.7.4/hooks.php(161): usu_init->i(Array) #1 /XXXXX/XXXXX/XXXXX/includes/application_top.php(33): hooks->generate('system', 'startApplicatio...') #2 /XXXXX/XXXXX/XXXXX/index.php(13): require('/XXXXX/XXXXX/...') #3 {main} thrown in /home/babouche/test/includes/classes/usu_init.php on line 16

 

Share this post


Link to post
Share on other sites

Have you installed over a previous version? Can you go to admin->modules->hooks and let me know if function_surface->usu_href_link  is listed at that  page?

Share this post


Link to post
Share on other sites

For now I've found an untraslated constant: TITLE_USU_INFO_PAGES_URI

It only affects the setup page. I'll wait to see if there are any more fixes to update the app.

Share this post


Link to post
Share on other sites
Posted (edited)

I've just tested on 1.0.7.12 and found that navigation class has changed from 1.0.7.11. It throws notices on hreflang class. You can avoid those if appears by commmenting line 62 of includes\apps\ultimate_seo_urls\includes\hreflang.php:

//      $this->mode = $navigation_data_array['mode'];

and change function line 112 to:

    protected function buildLink($default = false, $language_code ) {
      if ( false === $this->session_started ) {
        return  $this->multiLanguage( tep_href_link( 'index.php', '', 'NONSSL' ), $default, $language_code );
      }
      return $this->multiLanguage( tep_href_link( $this->page, $this->getQuery() ), $default, $language_code );
    }

 

Edited by piernas

Share this post


Link to post
Share on other sites

Hi @piernas

I managed to have it work on my Phoenix 1.0.7.6. I will now update Phoenix progressively, to better monitot the errors. 

One remark though: in my old USU5 version, I could choose the type of url "cp", ie: category-productName.html. This setting exists the category name is never added at the beginning of the URI. I reset/desactivated the cache.

Thanks

Share this post


Link to post
Share on other sites
18 minutes ago, marokech said:

Hi @piernas

I managed to have it work on my Phoenix 1.0.7.6. I will now update Phoenix progressively, to better monitot the errors. 

One remark though: in my old USU5 version, I could choose the type of url "cp", ie: category-productName.html. This setting exists the category name is never added at the beginning of the URI. I reset/desactivated the cache.

Thanks

You're right, categories are not being added while manufacturer and model are. I'll look at it. Please let me know if you find something else.

Share this post


Link to post
Share on other sites

Thanks, Yes I'm updating my test Phoenix gradually, and checking the the errors for each version beyond 1.0.7.6 :)

Share this post


Link to post
Share on other sites

@marokech I think I found the issue with categories into product url. I think I left some test code. Could you try editing :

includes\apps\ultimate_seo_urls\page_modules\product_info.php line 202:

//      $text_types = array( 'p' => $details['products_name'], 'c' => $details['categories_name'] );
      $text_types = array( 'p' => $details['products_name'] );

Change to

      $text_types = array( 'p' => $details['products_name'], 'c' => $details['categories_name'] );

and see if it works?

Share this post


Link to post
Share on other sites
Posted (edited)

Hi @piernas

I tested till Phoenix version 1.0.7.9, and I think I can make a quick feedback at this stage. The url rewriting is working perfectly. Thank you again for this addon. 

However, there is an issue with multilanguage, "canonical links" and "hreflang tags". 

1) Multilanguage: 

I use the tags dir="ltr" lang="en" in my languages pages, and when I view the source on firefox (you can click the hreflang links directly in firefox to view different languages' sources), it is strange because my lang tag shows other languages than the active ones. it seems arbitrary...Just one guess: I think the language_usu bar in the header should not show the active language but n-1 (n is the number of shop languages). 

2) Canonical links: 

The Hreflang tags apprear to be ok, but when I test them in this tool: https://technicalseo.com/tools/hreflang/ It says they are wrong. The reason is that the canonical link for index is wrong as it shows xxxx/index.php for default language. It is wrong in my case because i redirect index.php to root. In my live shop that uses the older USU5 version, my canonical home page does not show "index.php" and hreflang tags pass the test perfectly. 

3) Hreflang tags:

When I use Firefox source viewing, and view a product with accents in its name, the hreflang links change when I click on different hreflang links. ie: the accents are corrected when the language is active, but when you source view other languages, the accents are just deleted from the url. This send different versions of hreflang links, which bring errors in search console. The solution I found in the previous version of USU5 is to fill all language files in the character conversion with the accentuated letters conversion, even if the language does not have accentuated letters. I share attached my english, french, espanol and german files from characters conversion folder to better see what I mean. This solves the issue with hreflang errors. 

I don't have a solution for the moment, for points 1 and 2. If you do, it would be perfect. 

Cheers

english.php

espanol.php

french.php

german.php

Edited by marokech

Share this post


Link to post
Share on other sites

(1) is fine, hreflang must include all languages including the one used. I was thinking the same but Raiwa pointed me I was wrong and changed it.

I'll check (2) as soon as possible.

For (3) I'm not sure if it was always working wrong. I had the same idea as you (using same file for all languages) but finally didn't do it because I'm not sure what characters I must use, especially in non-latin languages. I'll check what happens.

Share this post


Link to post
Share on other sites
Posted (edited)

Thanks @piernas

Regarding 3), yes there've always been this problem, which creates duplicate hreflang links for the same page (got thousands of errors in the past because of that). With one file (content but different names) for the 4 languages that includes all special characters, it worked for me (tested and approved by Google Search Console), also working with your update 3.0. 

Regarding 1) I wasn't referring to the hreflang links, which I agree, there should be all languages including the active one. I was rather referring  to the language selection in the navbar (/navbar/nb_languages_usu.php), normally the active language should not be in the dropdown list. 

 

good night!

 

Edited by marokech

Share this post


Link to post
Share on other sites

Hola @piernas

Just finished upgrading from Phoenix 1.0.7.3 to 1.0.7.12. Installed Ultimate SEO URL at version 1.0.7.5 and worked fine all along the versions, at the exception of the above mentioned issues. Regarding the 2 notices when upgrading from 1.0.7.11 to 1.0.7.12, i applied only your first recommendation, the second (updating the function) throws a parse error.

Coming back to issue 1) I highlighted in my previous post, it seems the language (example: new products for January) is not updated instantly, the page needs to be refreshed before. Ex. When I switch from English to German, it still shows "Neue Produkte im JANUARY", (the month did not change), and if I refresh the page, then it shows: "Neue Produkte im JANUAR". I don't know if it is only linked to my updates or to the add-on. 

Share this post


Link to post
Share on other sites

App updated: https://apps.oscommerce.com/Imrlq&amp;ultimate-seo-urls-rewritter-for-phoenix

  • Updated to work with Phoenix from 1.0.7.5 to 1.0.7.13
  • Removed unused configuration option.
  • Now the app can be installed/uninstalled from admin.
  • Added x-default hreflang tag.
  • Corrected hreflang links not using language character conversion when another language page is loaded.
  • Corrected canonical tags for index page if force remove index.php is enabled.
  • Navbar and box language selections can now show/hide current language.

 

Edited by piernas

Share this post


Link to post
Share on other sites

Hi @piernas

I have a strange problem with products that have  german Umlauts in their product name. I can't add them to the cart from the product info page.

Products without attributes can be added from product listing.

If I change to english: no problem.

While the product_info url  looks like:

bio-hanfoel-kaltgepresst-p-71059.html

The form looks like

<form name="cart_quantity" action="https://www.xxx.yyy/2019/phoenix/bio-hanfl-kaltgepresst-p-71059.html?action=add_product" method="post" role="form">

So it seems the  character conversions doesn't work here, could this be the problem?

Best regards

Christoph

Edited by beerbee

Share this post


Link to post
Share on other sites
3 hours ago, piernas said:

@beerbee does it happen only with products with special characters?

Exactly - no problem with names without umlauts.

Best regards

Christoph

Share this post


Link to post
Share on other sites

@beerbee @marokech I have just installed latest code from github and I am experiencing new issues with languages (some boxes and modules dissapear when changing language). I'll wait until the code that affects the app is stable to try to fix it.

Edited by piernas

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

×