ceon_uri_mapping

Configuration

Essential Points - PLEASE READ!

Table Of Contents

  1. Configuring the URI Mapping Auto-generation settings
  2. Ensuring 100% Compatibility with Third Party Zen Cart Modules - Specifying Individual Files to be Excluded from URI Mapping
  3. Setting up a Rewrite Rule
    1. Example rule for stores installed in the root of the site, with the admin named “admin”.
    2. Example rule for stores installed in a folder other than the root of the site, with the admin named “admin”.
    3. Modifying the rule for stores which have renamed the admin directory.
    4. Modifying the rule to allow URI mappings to be used which end with a particular file extension (e.g. “.html”).
    5. Adding exceptions to the rule to prevent particular addresses (e.g. Control Panels etc.) from being handled by Zen Cart.
  4. Specifying the current URI Mapping for a Category
  5. Specifying the current URI Mapping for a Product
  6. Specifying the current URI Mapping for a Manufacturer
  7. Specifying the current URI Mapping for an EZ-Page
  8. Organise EZ-Pages into Site Sections
  9. Specifying the current URI Mapping for any other Zen Cart page
  10. Using Static URIs as an Alias for another Static URI
  11. Specifying URI Parts for standard Zen Cart pages related to a Product
  12. Enabling/Disabling the URI Mapping module
  1. Configuring the URI Mapping Auto-generation settings

    The Auto-generation settings settings in the configuration utility can be used to:

    • Change the Capitalisation setting,
    • Change the Whitespace Replacement Character,
    • Edit the list of words which are automatically Removed when auto-generating the URIs and
    • Edit the list of characters/strings that will be Replaced when auto-generating URIs (along with their respective replacements).
    • Go to Modules > URI Mapping (SEO) Config in the Zen Cart admin.

    If the store is using any Whitespace Replacement Character other than a single dash (“-”), or the Capitalisation setting isn't set to “Convert to lowercase”, then the URI Parts for standard Zen Cart pages related to a Product must be checked and changed accordingly.

    • Read this section of the configuration documentation, adjusting the URI Parts to match the chosen Whitespace Replacement Character for the store.

    Back to table of contents

  2. Ensuring 100% Compatibility with Third Party Zen Cart Modules - Specifying Individual Files to be Excluded from URI Mapping

    Please Note: Nothing will need to be done for this step for most stores. If direct help from Ceon is required, please consult our support options.

    Certain Zen Cart modules have files which load up the Zen Cart system directly so they can process payment callbacks or dynamically load information using JavaScript (various “AJAX” modules) etc.

    Ceon URI Mapping cannot distinguish these files from legitimate static URIs, as “behind the scenes” they don't act like a normal Zen Cart page.

    To ensure that these files aren't adversely affected by the URI Mapping module, they should be excluded from being processed by the module by entering the paths to the files in the configuration utility.

    What modules have exclusions by default?

    The only standard Zen Cart modules (i.e. the only modules included in a fresh installation of Zen Cart) which require an exclusion are the NoChex and PayPal IPN modules.

    The default exclusions the module is configured with exclude the callback files for the following payment modules:

    • NoChex
    • PayPal IPN
    • Protx Direct
    • Ceon Sage Pay Direct
    • Ceon Sage Pay Server
    • Iridium
    • Realex Remote

    The default exclusions the module is configured with also exclude the appropriate file for the following module:

    • Ceon Advanced Shipper Localities
    • If the store doesn't any use any third party modules, apart from - possibly - any of those mentioned directly above, then nothing needs to be configured here - you can move on to the next configuration step: Setting up a Rewrite Rule.
    • If the store does use any any third party modules not mentioned directly above, then, although there aren't likely to be many other modules which require exclusions for any of their files, it would be a good idea to make sure that Ceon URI Mapping is made fully compatible, if necessary, with the other third party modules being used on the store...

    How can I tell if a file in a third party module should be excluded?

    • For a file to load the Zen Cart system directly it must have the following line in it:

      require('includes/application_top.php');

      The file will more than likely be in the root directory of the Zen Cart installation (e.g. / or /shop).

    • Some third party modules keep their files in a subdirectory, in which case the line to load the Zen Cart system may have characters in the include path to move up to the “parent” directory (‘../’):

      require('../includes/application_top.php');

    • Check all the files in the root directory of the Zen Cart installation, and any files installed by any other third party modules, to see if they contain a line that loads in application_top.php - the require command will mostly likely be near the top of the file.

    The only files which contain the above line in a fresh installation of Zen Cart are index.php, ipn_main_handler.php and nochex_apc_handler.php - these can be ignored as the module already has built-in support for excluding the ipn_main_handler.php and nochex_apc_handler.php files, and the index.php file should not be excluded.

    Any files which came with the modules listed above can also be ignored as the module already has built-in support for excluding the appropriate files for those modules.

    How can a file in a third party module be excluded?

    Excluding a file from being processed by the URI Mapping module is a simple matter:

    • Go to Modules > URI Mapping (SEO) Config in the Zen Cart admin.
    • Add the path of the file on the site to the Excluded Files configuration setting, seperating it from any currently excluded files with a comma (‘,’).
    • The path should start from the store's root slash.
    • For example:

      /shop/name_of_file_to_exclude.php

    Back to table of contents

  3. Setting up a Rewrite Rule

    The URI mapping provided by this module is made possible using a very simple URI rewriting rule.

    This rule must be added to the webserver configuration for the site.

    For the Apache webserver, this rule can either be put in the VirtualHost directive for the site or within a .htaccess file (if the appropriate security settings allow its use within .htaccess files).

    Please Note: If putting this rule in a VirtualHost directive, the RewriteRule will need to have the relative path to the Zen Cart directory prepended to index.php.

    Details of how to enable mod_rewrite or how to add this rule to the Apache configuration will not be given here, please consult the Apache documentation or search the internet for a guide, there are plenty of them.

    If an error is encountered, please consult the FAQs for possible fixes or ask your webhost for help. Only after trying those two options should you post to the forum as the problem is likely to be server-specific and therefore of no general interest to everyone else who needs to use the support thread!

    1. Example rule for stores installed in the root of the site, with the admin named “admin”.
    2. Example rule for stores installed in a folder other than the root of the site, with the admin named “admin”.
    3. Modifying the rule for stores which have renamed the admin directory.
    4. Modifying the rule to allow URI mappings to be used which end with a particular file extension (e.g. “.html”).
    5. Adding exceptions to the rule to prevent particular addresses (e.g. Control Panels etc.) from being handled by Zen Cart.
    1. Example rule for stores installed in the root of the site, with the admin named “admin”.

      Please Note: This rewrite rule is for sites which have Zen Cart installed in the root folder of their site and which have not renamed the admin directory from “admin&rdquo to something else. For Zen Cart installations which use a different folder for the store and/or a different admin folder, information on how to modify the rewrite rule appropriately follows later.

      Please Note: This example rule is intended for a .htaccess file placed in the same directory as the Zen Cart installation's index.php file.

      • RewriteEngine On
        
        # Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
        RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
        # Don't rewrite admin directory
        RewriteCond %{REQUEST_URI} !^/admin [NC]
        # Don't rewrite editors directory
        RewriteCond %{REQUEST_URI} !^/editors [NC]
        # Don't rewrite cPanel directories
        RewriteCond %{REQUEST_URI} !/cpanel [NC]
        RewriteCond %{REQUEST_URI} !/frontend [NC]
        # Handle all other URIs using Zen Cart (index.php)
        RewriteRule .* index.php?%{QUERY_STRING} [L]
        

      If placing the above rule in a VirtualHost directive for the site, the main RewriteRule needs to have the store's relative directory path prepended. The RewriteRule should be changed to:

      • RewriteRule .* /index.php?%{QUERY_STRING} [L]
        

      If the store uses any control panels etc. which are blocked because of the rewrite rule, a RewriteCond must be added to allow access again. More information about adding exceptions to the rewrite rule can be found here.

    2. Example rule for stores installed in a folder other than the root of the site, with the admin named “admin”.

      As mentioned above, if a store is not installed in the root directory of a site, that is, if in includes/configure.php the DIR_WS_CATALOG define isn't exactly as follows:

      define('DIR_WS_CATALOG', '/');

      Then the rewrite rule needs to be modified to point to the store's folders.

      For example, if the store's DIR_WS_CATALOG define is:

      define('DIR_WS_CATALOG', '/shop/');

      Then all of the RewriteConds from “# Don't rewrite admin directory” downwards need to have the forward slash, “/”, changed to “/shop/”.

      If the store has other pages on the site which aren't part of Zen Cart - that is, from the example above, pages which aren't in the “/shop” directory - then a RewriteCond must also be added so that these other pages keep working.

      The resulting rewrite rule would then be as follows.

      Please Note: The following example rule is intended for a .htaccess file placed in the same directory as the Zen Cart installation's index.php file.

      • RewriteEngine On
        
        # ONLY rewrite URIs beginning with /shop/
        RewriteCond %{REQUEST_URI} ^/shop/ [NC]
        # Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
        RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
        # Don't rewrite admin directory
        RewriteCond %{REQUEST_URI} !^/shop/admin [NC]
        # Don't rewrite editors directory
        RewriteCond %{REQUEST_URI} !^/shop/editors [NC]
        # Don't rewrite cPanel directories
        RewriteCond %{REQUEST_URI} !/cpanel [NC]
        RewriteCond %{REQUEST_URI} !/frontend [NC]
        # Handle all other URIs using Zen Cart (index.php)
        RewriteRule .* index.php?%{QUERY_STRING} [L]
        

      If placing the above rule in a VirtualHost directive for the site, the main RewriteRule needs to have the store's relative directory path prepended. The RewriteRule should be changed to:

      • RewriteRule .* /shop/index.php?%{QUERY_STRING} [L]
        

    3. Modifying the rule for stores which have renamed the admin directory.

      If the store does not use “admin”. for the name of the admin directory then the RewriteCond for the admin directory must be modified: “RewriteCond %{REQUEST_URI} !/admin [NC]”.

      For example, if the store's admin directory is named “store_manager” and Zen Cart is installed in the root directory of the site, the example rewrite rule above would be modified as follows:

      # Don't rewrite admin directory
      RewriteCond %{REQUEST_URI} !^/store_manager [NC]

      Obviously, if the store isn't installed in the root directory of the site, the RewriteCond for the admin folder would have to be modified accordingly. As an example:

      # Don't rewrite admin directory
      RewriteCond %{REQUEST_URI} !^/shop/store_manager [NC]

    4. Modifying the rule to allow URI mappings to be used which end with a particular file extension (e.g. “.html”).

      The example rewrite rules by default do not rewrite URIs ending with a 2 to 4 letter file extension, to avoid wasteful attempts by the later rules to check if image files, CSS files etc. should have their URIs rewritten, and for maximum compatibility with other software being used to run the site.

      However, some stores may need to use particular extensions - for example “.html” or “.php” - at the end of its URIs, possibly to match up with advertising literature, or to re-map URIs from a previous site.

      It's easy to let the URI Mapping module manage URIs with any file extension by making a simple change to the rewrite rule.

      For example, to allow the mapping of URIs ending in “.html”, the following RewriteCond from the example rule should be changed from:

      RewriteCond %{REQUEST_URI} !\.[a-zA-Z]{2,5}$

      to:

      RewriteCond %{REQUEST_URI} !\.[a-zA-Z]{2,5}$ [OR]
      RewriteCond %{REQUEST_URI} \.(html)$ [NC]

      Additional extensions can be added by adding them to the RewriteCond with a ‘|’ in front of them.

      For example, to allow the mapping of URIs ending in “.html”, “.htm” and “.php”, the following RewriteCond from the example rule should be changed from:

      RewriteCond %{REQUEST_URI} !\.[a-zA-Z]{2,5}$

      to:

      RewriteCond %{REQUEST_URI} !\.[a-zA-Z]{2,5}$ [OR]
      RewriteCond %{REQUEST_URI} \.(html|htm|php)$ [NC]

    5. Adding exceptions to the rule to prevent particular addresses (e.g. Control Panels etc.) from being handled by Zen Cart.

      If the rewrite rule is blocking access to particular addresses on the server, exclusions need to be added to the rule for any addresses that should not be handled by Zen Cart.

      The example rules listed above have two exclusions for the popular CPanel control panel. Examining them should make it obvious how to add extra exclusions:

      # Don't rewrite cPanel directories
      RewriteCond %{REQUEST_URI} !/cpanel [NC]
      RewriteCond %{REQUEST_URI} !/frontend [NC]

      In the above, the “/cpanel” and “/frontend” addresses have been added as exclusions and won't be handled by Zen Cart.

    Back to table of contents

  4. Specifying the current URI Mapping for a Category

    Specifying the current URI mapping for a Category, for each language used by the store, is easily accomplished:

    • Use Catalog > Categories/Products to navigate to the category the desired category is within.
    • Click the (green) icon for “Edit” alongside the category's name or click the “New Category” button if adding a new category.

    The URI mapping can be automatically generated using the store's URI mapping auto-generation settings:

    • The URI mapping fields can be found at the bottom of the page.
    • Simply tick the URI mapping auto-generation text box and click “Save”.
    • The URI mapping will then be generated using the full path to the current category and the name of the category. For stores with multiple languages, a URI mapping will be generated for each language, using the respective category names entered for each language.

    Or the current URI mapping can be entered manually:

    • The text field(s) for entering the URI mapping(s) which should map this category can be found at the bottom of the page.
    • If the URI mapping auto-generation text box is ticked, it must have the tick removed.
    • Simply enter the URI mappings for the category (for each language the store uses) in the text field(s) and click “Save”.
    • Please Remember: URI mappings entered manually must be relative to the root of the site (“/”), and must be the full path to the category. E.g. “/category-one/subcategory-of-category-one

    Changing the current URI Mapping for a Category

    Changing the current URI mapping for a Category is easily accomplished by following the same steps as for specifying one in the first place.

    • The URI mapping can be completely re-generated or a new URI mapping can be entered manually for each language the store is using.
    • If the store uses multiple languages and auto-generation is used to update the URI mappings, the URI mappings for all languages for the category will be updated, overwriting any previous values.

    Please Note: The previous URI mapping will still point towards the category but anyone using it will be redirected to the current URI - this prevents broken links.

    Removing the current URI mapping for a Category

    • Use Catalog > Categories/Products to navigate to the category the desired category is within.
    • Click the (green) icon for “Edit” alongside the category's name.
    • Clear the value entered in the text field for the appropriate language (or clear the values for all the languages!): Delete the text, leaving the text field blank.
    • Click “Save”

    Please Note: The previous URI mapping will still point towards the category but anyone using it will be redirected to the standard Zen Cart dynamic URI for the category - this prevents broken links.

    Back to table of contents

  5. Specifying the current URI Mapping for a Product

    Specifying the current URI mapping for a Product, for each language used by the store, is easily accomplished:

    • Use Catalog > Categories/Products to navigate to the product the desired product is within.
    • Click the (green) icon for “Edit” alongside the product's name or click the “New Product” button if adding a new product.

    The URI mapping can be automatically generated using the store's URI mapping auto-generation settings:

    • The URI mapping fields can be found at the bottom of the page.
    • Simply tick the URI mapping auto-generation text box and click “Preview”.
    • The URI mapping will then be generated using the full path to the current product and the name of the product. For stores with multiple languages, a URI mapping will be generated for each language, using the respective product names entered for each language.
    • The auto-generated URI mappings for each language the store is using will be displayed below the product's description.
    • Click “Update” to save the product's information, including its URI mapping(s).

    Or the current URI mapping can be entered manually:

    • The text field(s) for entering the URI mapping(s) which should map this product can be found at the bottom of the page.
    • If the URI mapping auto-generation text box is ticked, it must have the tick removed.
    • Simply enter the URI mappings for the product (for each language the store uses) in the text field(s) and click “Preview”.
    • Please Remember: URI mappings entered manually must be relative to the root of the site (“/”), and must be the full path to the product. E.g. “/category-one/subcategory-of-category-one/product-three
    • The entered URI mapping(s), for each language the store is using, will be displayed below the product's description, properly formatted to remove any unusable characters.
    • If satisifed with the format of the URI click “Update”. To make changes click “Back”.

    Changing the current URI Mapping for a Product

    Changing the current URI mapping for a Product is easily accomplished by following the same steps as for specifying one in the first place.

    • The URI mapping can be completely re-generated or a new URI mapping can be entered manually for each language the store is using.
    • If the store uses multiple languages and auto-generation is used to update the URI mappings, the URI mappings for all languages for the product will be updated, overwriting any previous values.

    Please Note: The previous URI mapping will still point towards the product but anyone using it will be redirected to the current URI - this prevents broken links.

    Removing the current URI mapping for a Product

    • Use Catalog > Categories/Products to navigate to the product the desired product is within.
    • Click the (green) icon for “Edit” alongside the product's name.
    • Clear the value entered in the text field for the appropriate language (or clear the values for all the languages!): Delete the text, leaving the text field blank.
    • Click “Preview”.
    • The URI mapping(s) for the appropriate language(s), displayed below the product's description, should simply say “No URI Mapping”.
    • Click “Update” to save the product's details and delete the cleared URI mapping(s). To make changes click “Back”.

    Please Note: The previous URI mapping will still point towards the product but anyone using it will be redirected to the standard Zen Cart dynamic URI for the product - this prevents broken links.

    Back to table of contents

  6. Specifying the current URI Mapping for a Manufacturer

    Specifying the current URI mapping for a Manufacturer, for each language used by the store, is easily accomplished:

    • Use Catalog > Manufacturers to navigate to the desired manufacturer.
    • Click the (green) icon for “Edit” alongside the manufacturer's name or click the “Insert” button if adding a new manufacturer.

    The URI mapping can be automatically generated using the store's URI mapping auto-generation settings:

    • The URI mapping fields can be found at the bottom of the page.
    • Simply tick the URI mapping auto-generation text box and click “Save”.
    • The URI mapping will then be generated using the full path to the current manufacturer and the name of the manufacturer. For stores with multiple languages, a URI mapping will be generated for each language, using the respective manufacturer names entered for each language.

    Or the current URI mapping can be entered manually:

    • The text field(s) for entering the URI mapping(s) which should map this manufacturer can be found at the bottom of the page.
    • If the URI mapping auto-generation text box is ticked, it must have the tick removed.
    • Simply enter the URI mappings for the manufacturer (for each language the store uses) in the text field(s) and click “Save”.
    • Please Remember: URI mappings entered manually must be relative to the root of the site (“/”), and must be the full path to the manufacturer. E.g. “/ceon

    Changing the current URI Mapping for a Manufacturer

    Changing the current URI mapping for a Manufacturer is easily accomplished by following the same steps as for specifying one in the first place.

    • The URI mapping can be completely re-generated or a new URI mapping can be entered manually for each language the store is using.
    • If the store uses multiple languages and auto-generation is used to update the URI mappings, the URI mappings for all languages for the manufacturer will be updated, overwriting any previous values.

    Please Note: The previous URI mapping will still point towards the manufacturer but anyone using it will be redirected to the current URI - this prevents broken links.

    Removing the current URI mapping for a Manufacturer

    • Use Catalog > Manufacturers to navigate to the desired manufacturer.
    • Click the (green) icon for “Edit” alongside the manufacturer's name.
    • Clear the value entered in the text field for the appropriate language (or clear the values for all the languages!): Delete the text, leaving the text field blank.
    • Click “Save”

    Please Note: The previous URI mapping will still point towards the manufacturer but anyone using it will be redirected to the standard Zen Cart dynamic URI for the manufacturer - this prevents broken links.

    Back to table of contents

  7. Specifying the current URI Mapping for an EZ-Page

    Specifying the current URI mapping for an EZ-Page, for each language used by the store, is easily accomplished:

    • Click Tools > EZ-Pages and navigate to the page the desired EZ-Page is on.
    • Click the (green) icon for “Edit” alongside the EZ-Page's title or click the “New File” button if adding a new EZ-Page.

    The URI mapping can be automatically generated using the store's URI mapping auto-generation settings:

    • The URI mapping fields can be found at the bottom of the page.
    • Simply tick the URI mapping auto-generation text box and click “Update”/“Insert”.
    • The URI mapping will then be generated using the full path to the current EZ-Page and the title of the EZ-Page. As EZ-Pages only support one language, the same URI mapping will be generated for each language the store uses, using the EZ-Page title entered.

    Or the current URI mapping can be entered manually:

    • The text field(s) for entering the URI mapping(s) which should map this EZ-Page can be found at the bottom of the page.
    • If the URI mapping auto-generation text box is ticked, it must have the tick removed.
    • Simply enter the URI mappings for the EZ-Page (for each language the store uses) in the text field(s) and click “Update”/“Insert”.
    • Please Remember: URI mappings entered manually must be relative to the root of the site (“/”), and must be the full path to the EZ-Page. E.g. “/about-us

    Changing the current URI Mapping for an EZ-Page

    Changing the current URI mapping for an EZ-Page is easily accomplished by following the same steps as for specifying one in the first place.

    • The URI mapping can be completely re-generated or a new URI mapping can be entered manually for each language the store is using.
    • If the store uses multiple languages and auto-generation is used to update the URI mappings, the URI mappings for all languages for the EZ-Page will be updated, overwriting any previous values.

    Please Note: The previous URI mapping will still point towards the EZ-Page but anyone using it will be redirected to the current URI - this prevents broken links.

    Removing the current URI mapping for an EZ-Page

    • Click Tools > EZ-Pages and navigate to the page the desired EZ-Page is on.
    • Click the (green) icon for “Edit” alongside the EZ-Page's title.
    • Clear the value entered in the text field for the appropriate language (or clear the values for all the languages!): Delete the text, leaving the text field blank.
    • Click “Update”

    Please Note: The previous URI mapping will still point towards the EZ-Page but anyone using it will be redirected to the standard Zen Cart dynamic URI for the EZ-Page - this prevents broken links.

    Back to table of contents

  8. Organise EZ-Pages into Site Sections

    EZ-Pages can be organised into logical sections by simply putting a bit of thought into the format of their URI mappings.

    • A main section should use the first part of the URI. For example:
    • An EZ-Page with the main information about a company could use the URI mapping:

      /company
    • A subsection should use a combination of the URI mapping for its parent section and a new part of the URI. For example:
    • An EZ-Page with directions on how to get to a company's offices could use the URI mapping:

      /company/how-to-find-us
    • Another main section would use different text for the first part of the URI. For example:
    • An EZ-Page with the main support information for a company could use the URI mapping:

      /support

    Hard-coded menus (e.g. Javascript drop-down menus etc.) could then make use of these URIs to link directly to the appropriate section or page within a section, giving the illusion of a structured site with a logical hierarchy!

    Back to table of contents

  9. Specifying the current URI Mapping for any other Zen Cart page

    There are two ways to specify static URIs for a Zen Cart page.

    1. The first is the most useful as it results in all links on the site to that page using the static URI instead of the standard dynamic Zen Cart URI (just as with products etc. using URI mappings).

      Please Note: Any query string parameters are still appended to the URI.

      Basically, this first method can be used to replace the likes of:

      index.php?main_page=products_all&disp_order=3

      with:

      /our-products?disp_order=3.

      • Use software such as PHPMyAdmin to add a new record to the ceon_uri_mapping table.
      • The URI mapping to be mapped from should be entered in the uri field. (Remember to begin the URI with a slash ‘/’).
      • The number representing the language ID this URI mapping applies for should be entered in the language_id field.
      • The current_uri field should be set to “1” to make this the “current” URI.
      • The Zen Cart page to be mapped to should be entered in the main_page field.
      • The date/time this URI mapping was added should be set in the date_added field (or just use the “NOW()” SQL function).
      • The query_string_parameters, associated_db_id and alternate_uri fields are not used, they must be left as “NULL”. The redirection_type_code is not used either so it doesn't matter what value it has (it can just be left at the default value of 301).
    2. The second is designed to allow data to be supplied to Zen Cart, by initialising the GET variables for the Zen Cart page when it is loaded.

      Please Note: Since the second method matches against the exact query string parameters entered, when generating links on the site, the query string parameters have to match exactly or the URI entered won't be used as the link to the Zen Cart page entered, the standard Zen Cart dynamic URI will.

      Any other parameters in the query string will cause this URI not to be used as the static URI in links.. even sort parameters (“disp_order=3”) will be enough to prevent the dynamic URI mapping to the URI entered here.

      For this reason it's recommended in most cases just to match against the page's name using the first method, the second method really is only for very specific circumstances when data needs to be loaded for a page. For example:

      When mapping a uri of ”/christmas-survey“ to a main_page of ”survey“ with query_string_parameters of “survey_id=12”.

      • Use software such as PHPMyAdmin to add a new record to the ceon_uri_mapping table.
      • The URI mapping to be mapped from should be entered in the uri field. (Remember to begin the URI with a slash ‘/’).
      • The number representing the language ID this URI mapping applies for should be entered in the language_id field.
      • The current_uri field should be set to “1” to make this the “current” URI.
      • The Zen Cart page to be mapped to should be entered in the main_page field.
      • If any GET variables should be set, simply enter them in the query_string_parameters field, separating each pair with an ampersand (‘&’), but not starting the string with a question mark or an ampersand.
      • For example, to map to a custom survey page, with the necessary survey_type and survey_id for the survey to be shown, the main_page field would be set to:
      • survey
      • and the query_string_parameters field would be set to:
      • survey_type=4&survey_id=23
      • The date/time this URI mapping was added should be set in the date_added field (or just use the “NOW()” SQL function).
      • The associated_db_id and alternate_uri fields are not used, they must be left as “NULL”. The redirection_type_code is not used either so it doesn't matter what value it has (it can just be left at the default value of 301).

    Back to table of contents

  10. Using Static URIs as an Alias for another Static URI

    Redirecting from one URI mapping to another is easily done.

    • Use software such as PHPMyAdmin to add a new record to the ceon_uri_mapping table.
    • The URI mapping to be mapped from should be entered in the uri field. (Remember to begin the URI with a slash ‘/’).
    • The number representing the language ID this URI mapping applies for should be entered in the language_id field.
    • The current_uri field should be set to “1” to make this the “current” URI.
    • The URI mapping to be mapped to should be entered in the alternate_uri field.
    • The type of redirection (temporary/permanent etc.) should be specified by entering the appropriate HTTP Status Code in the redirection_type_code field. Values supported by the module are: 301, 302, 303, 307.
    • The date/time this URI mapping was added should be set in the date_added field (or just use the “NOW()” SQL function).
    • The main_page, query_string_parameters and associated_db_id fields are not used, they must be left as “NULL”.

    Back to table of contents

  11. Specifying URI Parts for Products' “Reviews” and “Tell-A-Friend” pages

    The Reviews and Tell-A-Friend sections are automatically made “subsections” of products' main info page, by appending some specific URI parts to the product info page's static URI.

    The URI Parts which are used by default in the module may not match the format of the store's other URI mappings so it may be necessary to specify different ones which match the store's URI mappings format.

    • Edit the “admin languages file” for the module: admin/includes/languages/english/extra_definitions/ceon_uri_mapping.php.

    Please Note: This must be done for each language the store uses.

    Back to table of contents

  12. Enabling/Disabling the URI Mapping module

    The URI mappings module is fully “backwards compatible” with Zen Cart's standard URIs so there's no realistic need ever to disable it. All of the store's existing Zen Cart URIs will continue to work as always (and will redirect to any current URI mapping which matches a particular page!).

    However, some store owners may decide that they don't want the links in their site to use their newly-added static URIs until they've finished adding all the mappings.

    The module can be disabled (and re-enabled again) easily through an option in the Zen Cart admin:

    • Go to Configuration > URI Mapping (SEO) in the Zen Cart admin, the option to disable/enable the module can be changed there.

    Back to table of contents

Back to top