Ultimate SEO URLS rewritter for Phoenix 1.0.7.11+

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

Features

URL Rewrite

User Friendly 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 icludes 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="de" href="http://www.mysite.com/es/my-estupenda-categoria-c-3.html" />

Cache

UFR 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

The new 404 page includes the 404 header, as opposite to the stock module.

You can personalize your "404 Not found" page. The template is located at: /templates/default/includes/pages/notfound_404.php

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.

Installation

  • Copy the files inside /catalog/ directory to the rooot of your site.
  • Enter your site once to
  • Access the Admin -> Configuration -> Ultimate SEO Urls to install the database tables and configure the app to fit your needs.

You have finished installation. There are no core code changes.

Htaccess file

Setup will try to add the following lines to the .htacces file on the root of your site. Succes will depend on your server's setup. If this can't be automatically done you'll have to manually modify this file by adding the follwing block at the end:

## BEGIN USU URL rewrite rules ## ## USU Version: 3.0.1 ## <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /CE-Phoenix-1.0.7.10a/ RewriteRule ^([a-z0-9/-]+)-c-([0-9_]+).html$ index.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-m-([0-9]+).html$ index.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-p-([0-9]+).html$ product_info.php [NC,L,QSA] RewriteRule ^([a-z0-9/-]+)-pi-([0-9]+).html$ info.php [NC,L,QSA] ## For rewrite, path_rewrite RewriteRule ^([a-z0-9/-]+)-pr-([0-9]+).html$ ext/modules/content/reviews/write.php [NC,L,QSA] ## For standard, path_standard RewriteRule ^write.php/([a-z0-9/-]+)-pr-([0-9]+) ext/modules/content/reviews/write.php [NC,L,QSA] </IfModule> ## END USU URL rewrite rules ##

Based on how you access your web shop modify RewriteBase as follows:

I access my site as www.mysite.com/ RewriteBase /
I access my site as www.mysite.com/catalog/ RewriteBase /catalog/
I access my site as www.mysite.com/catalog/shop/ RewriteBase /catalog/shop/

*nix server settings for RewriteRules

mod_rewrite must be compiled in apache and AllowOverride set to ALL in httpd.conf (usually this is already in place)

Windows IIS servers only

If you want to use ReWriteRules you have to have either ISAPI rewrite or IIS rewrite installed on the server, you will also have to have the .htaccess rules converted.

Some servers don't allow path based querystrings

If with the standard and path standard uris you get page not found this probably means that your server does not allow path based querystrings. In such cases you will need to use the rewrite uri types. To test if your server has this issue try accessing your web shop like www.mysite.com/index.php/test/. if it fails to load the page then you have this problem.

Settings

These are the settings you will find in Admin->Configuration->USU:

Enable SEO URLs Turn on/off switch for the whole app.
Enable the cache Turns caching system on/off.
No queries are used after the cache is fully loaded.
Select your chosen cache system.
File: Stores the cache as a text file.
MySQL: Stores the cache in the database.
SQLite: Stores the cache in a SQlite database. Needs Sqlite PHP extensions installed on the system.
Memcache: Stores the cache in memory. Needs Memcache installed on the system.
Set the number of days to store the cache How many days a cache will be kept before auto deleting itself.
Choose the URI format

Standard Seo Urls:
www.mysite.com/product_info.php/the-brand-etc-great-product-p-3

Path Standard Seo Urls:
www.mysite.com/product_info.php/the-brand-etc/great-product-p-3

Traditional Rewrite Seo Urls: (*)
https://https://www.mysite.com/the-brand-etc-great-product-p-3.html

Path Rewrite Seo Urls (*)
https://https://www.mysite.com/the-brand-etc/great-product-p-3.html

(*) = Requires mod_rewrite and RewriteRules added to .htaccess

Choose how your product link text is made up
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.
There are 49 different ways to write your products link text.
  • p = products name
  • c = category name
  • b = manufacturer name ( b for brand )
  • m = model
Filter Short Words
When creating a link from a product name you may want to remove the shorter words .. like a | or | at | the .. etc.

Default value is 1 but you can choose to filter short words of 1 2 or 3 letters.
A setting of 3 would filter out all words of three letters or less.
Add category parent to the beginning of the url Enables/disables the option of adding the category parent to the beginning of category URLs.
Remove all non-alphanumeric characters Removes all non alphanumeric characters. Default is true.
If your language uses special characters you will need to use the conversion system. See includes/apps/ultimate_seo_urls/includes/character_conversion directory and search for you language(s) files.
Add cPath to product URLs Adds ?cPath=x to the end of product urls.
Turn performance reporting on/off Shows USU5 performance at the bottom of your web shop.
Should be set to false on a live site!
Turn variable reporting on/off Shows USU5 class properties at the bottom of your web shop. Great for debugging.
Should be set to false on a live site!
Force www.mysite.com/ when www.mysite.com/index.php Redirects index.php to your base domain.
Beware! on some servers this creates a redirect loop so turn it on.
Try it. If it creates a loop then turn it OFF.
Reset SEO URLs Cache Clicking on "reset" will empty the cache.

New language box, language navbar and hreflang tags modules:

You can install or uninstall the optional modules directly in the app configuration screen instead of browsing for them in the modules menu.

When enabling one of the modules it will de-activate the corresponding stock module.

Hreflang and navbar/box modules are only useful if you have more than one language installed. Canonical module will work for all shops

New Canonical module

It has a modular construction, so you can create your own modules for custom pages and put them at /includes/apps/ultimate_seo_urls/canonical_modules/ directory.

Page modules

There are four stock modules for index.php, info.php, product_info.php and write.php. These modules will manage the URL rewriting for those stock pages that uses querystrings (i.e.?products_id=1).

You can create new modules for other apps at /includes/apps/ultimate_seo_urls/page_modules/ directory.

Multilanguage support

You have the ability to add individual character conversion files to the following directory:

catalog/includes/apps/ultimate_seo_urls5/includes/character_conversion/

The files must be named exactly the same as your language file in catalog/includes/languages/ - e.g. danish.php or german.php or espanol.php etc.

For most of these files I have tried to put the special characters in the array but it is up to you to add the English equivalents.

Changelog

R3.0.1 (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
  • New installation process. No core code changes or edits needed anymore.
  • Removed support for database language conversions.
  • New Canonical module
  • New 404 error page with template.
  • Support for write.php and info.php
  • Allow to processs links outside root folder (ie. ext/directory).
  • Initial

R2.09 beta (June 2018):

  • Latest responsive oscommerce compatible.
  • Moved usu_base_filename function from application_top to its own file to simplify core edits.
  • Allow to processs links outside root folder (ie. ext/directory). This is useful for addons like Twitter typeahead. (Currently not working)
  • Fixed some cache issues
  • Fix for sitemaps not showing manufacturer rewritten URLs
  • Fix for hreflang tags module
  • now categories shows correct language
  • Corrected location of character conversion packs

R2.08 (January 2017):

  • Now the multi-language support works without 301 redirects! Correct descriptions applied to URLs (also on sitemaps).
  • New box and navbar modules for multi-language support.
  • New hreflang tags module for header.
  • Added Class for setting the different multilanguage variables (used by boxes, navbar and header tags modules)
  • Checks in configuration setup for memcache and sqlite
  • Some more fixes from the forum thread added.

R2.07 (January 2017):

  • Removed support for versions lower than 2.3.4 responsive
  • Removed long arrays support
  • only superglobals used.
  • Changed remaining replaces for filenames and database tables variables to strings on page modules.
  • Included character conversion packs to uploads directory
  • no need of copying the files manually. You can remove unused languages safely fif you wish. These packs have been converted to UTF-8.
  • Added several small fixes from support forum users.
  • Modified install instructions.
  • Added new box and navbar modules for multilanguage support.