probably the best Zen Cart URI Mapping/SEO Module in the world! ...ever!
This module DOES NOT automatically add mappings for EXISTING Categories/Products/Manufacturers/EZ-Pages!
If the site has existing Categories/Products/Manufacturers/EZ-Pages, they'll continue to use the standard Zen Cart dynamic URIs, until a URI has been entered or auto-generated for them, by editing the respective Category/Product/Manufacturer/EZ-Page in the admin.
This means going in and editing every Category/Product/Manufacturer/EZ-Page for which a static URI mapping is desired.
This gives you full control over all of the site's URIs, one of the main points of this module.
Our URI Mappings Manager software will have the ability to auto-generate URI mappings for all/selected Categories/Products/Manufacturers/EZ-Pages at once.
All URI mappings entered must be relative to the site's root. For example:
/books/life-is-good
/clothes/children/t-shirts
/company/about-us
This means that the same URIs will map correctly no matter what the actual domain name being used to access the site is (e.g. www.yourstore.com or yourstore.com).
If “http://www.yourstore.com” is entered for a URI mapping it will be stripped from the mapping!
It is recommended that all URI mappings for products and categories should use a full path. For example:
/category-one/subcategory-of-category-one
/category-one/subcategory-of-category-one/product-three
/category-one/subcategory-two-of-category-one
/category-one/subcategory-two-of-category-one/product-fifteen
This keeps the site organised and avoids conflicts between two pages which are trying to use the same URI (e.g. “accessories” within one category being seen as the same URI as “accessories” within another category! In this case one of the categories could never be visited!).
Any URI mappings created using the module's URI auto-generation functionality will comply to both the above!
Auto-generated URI mappings will use the full path to a category/product and the name of the category/product. Auto-generated URI mappings for EZ-Pages will use the title of the page.
The Auto-generation settings settings in the configuration utility can be used to:
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.
Please Note: Nothing will did 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 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.
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:
The default exclusions the module is configured with also exclude the appropriate file for the following module:
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).
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.
Excluding a file from being processed by the URI Mapping module is a simple matter:
For example:
/shop/name_of_file_to_exclude.php
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!
Example rewrite rules follow.
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 .[xxxx])
RewriteCond %{REQUEST_URI} !\.[a-zA-Z]{2,4}$
# 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.
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 RewriteCond
s 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 .[xxxx])
RewriteCond %{REQUEST_URI} !\.[a-zA-Z]{2,4}$
# 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]
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]
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,4}$
to:
RewriteCond %{REQUEST_URI} !\.[a-zA-Z]{2,4}$ [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,4}$
to:
RewriteCond %{REQUEST_URI} !\.[a-zA-Z]{2,4}$ [OR]
RewriteCond %{REQUEST_URI} \.(html|htm|php)$ [NC]
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.
Specifying the current URI mapping for a Category, for each language used by the store, is easily accomplished:
The URI mapping can be automatically generated using the store's URI mapping auto-generation settings:
Or the current URI mapping can be entered manually:
Changing the current URI mapping for a Category is easily accomplished by following the same steps as for specifying one in the first place.
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.
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.
Specifying the current URI mapping for a Product, for each language used by the store, is easily accomplished:
The URI mapping can be automatically generated using the store's URI mapping auto-generation settings:
Or the current URI mapping can be entered manually:
Changing the current URI mapping for a Product is easily accomplished by following the same steps as for specifying one in the first place.
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.
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.
Specifying the current URI mapping for a Manufacturer, for each language used by the store, is easily accomplished:
The URI mapping can be automatically generated using the store's URI mapping auto-generation settings:
Or the current URI mapping can be entered manually:
Changing the current URI mapping for a Manufacturer is easily accomplished by following the same steps as for specifying one in the first place.
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.
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.
Specifying the current URI mapping for an EZ-Page, for each language used by the store, is easily accomplished:
The URI mapping can be automatically generated using the store's URI mapping auto-generation settings:
Or the current URI mapping can be entered manually:
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.
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.
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.
EZ-Pages can be organised into logical sections by simply putting a bit of thought into the format of their URI mappings.
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!
There are two ways to specify static URIs for a Zen Cart page.
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.
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”.
Redirecting from one URI mapping to another is easily done.
The Reviews and Tell-A-Friend sections are automatically made “subsections” of the product's 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 and so it may be desirable to specify different ones.
Please Note: This must be done for each language the store uses.
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: