I just noticed that Ultimate SEO URL has passed the Apple Zen template to become the most popular zencart plugin.
Printable View
I just noticed that Ultimate SEO URL has passed the Apple Zen template to become the most popular zencart plugin.
I HAVE THIS SAME ERROR:
OK
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
HTTP/1.1 200 OK Date: Fri, 14 Jun 2013 20:02:37 GMT Server: Apache/2.2.22 (Unix) FrontPage/5.0.2.2635 X-Powered-By: PHP/5.3.8 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Keep-Alive: timeout=3, max=196 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html; charset=utf-8 6d76
But it only appears in Firefox or Chrome browser when adding products to the shopping cart. Not in IE. Despite the error being briefly visable, the products get insert into the shopping cart. Any Suggestions and pointers is greatly appreciated.
Please Answer the following:
Version of Zen Cart?
Version of Ultimate (SEO) URLs?
Copy of .htaccess file?
Copy of server error log?
Copy of any Zen Cart debug file?
Typically "HTTP/500 Internal Server Error (or Internal Application Error), indicates a SERVER ERROR (either Apache/IIS, PHP, or another server module). This is a generic error telling you the Web Server itself encountered a fatal error in one of the Web Server's modules. Typical causes are: misconfiguration of the webserver, misconfiguration of directives in the .htaccess file, or the webserver not allowing a directive in the .htacess. There should be a "log" for server side errors (unless disabled by your hosting provider).
However, in your case I'm going to guess something else is going on. Fatal errors are rarely based upon browser... And I cannot duplicate the issue while browsing your website... I can add an item to my cart (on your website) using Firefox and IE without encountering this error...
I have seen this error on your site (last night) but it was on a completely unrelated page (category page). It was once out of about 30 page refreshes. Now I am getting all "HTTP / 404" errors for your site... Do you have a location we can see the error?
Did you install using the Zen Cart distribution zip from www.zen-cart.com (or did you use a one click install)? Is your hosting provider doing some sort of "caching", "proxying", or using a gridserver?
Version of Zen Cart? = v1.5.1
Version of Ultimate (SEO) URLs? v2.1.2
Copy of .htaccess file? please see below
Copy of server error log? No server logs available
Copy of any Zen Cart debug file? log folder in zencart is empty
###############################################################################
# Common directives
###############################################################################
# NOTE: Replace /shop/ with the relative web path of your catalog in the "Rewrite Base" line below:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /htdocs/BBT/ (PLEASE NOT THIS IS TRUNCATED. REAL PATH OF ZENCART WAS HERE)
###############################################################################
# Start Ultimate SEO URLs
###############################################################################
# Handles the new URL formats
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$4&cPath=$2&%{QUERY_STRING } [L]
# Original (unchanged) URL formats
RewriteRule ^(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-([0-9]+)(.*)$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-ezp-([0-9]+)(.*)$ index\.php?main_page=page&id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)(.*)$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
# All other pages
# Don't rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index\.php?main_page=$1&%{QUERY_STRING} [L]
ZC 1.5.1 was downloaded from the link that I received when clicking on you www. zen-cart.com link provided here. it was then unzipped after download, then extracted in my local computer. uploaded to host by filezilla and installed as instructed by zencart. After successful installation, I was ask to change admin directory, etc.... and I followed all the steps. Site was working and the the first thing installed was template followed by ty package, EO, SO, Recover cart, UPS, then finally U SEO. all are versions for zc1.5.1
As far as what the host do? I don't know. I can find out. The link was the www***.net link that I gave you on our PM.
Finally I found some "error logs". Please see below. The file have a lot of stuff in it. I just copied to last 11 entries in it.
[Sun Jun 16 00:30:02 2013][debug] net/instaweb/apache/mod_instaweb.cc(375): [client 108.90.150.61] ModPagespeed OutputFilter called for request /htdocs/myshop/ index.php?main_page=shopping_cart.html, referer: http://birthdaysextreme.net/shopping_cart.html
[Sun Jun 16 00:30:02 2013][debug] net/instaweb/apache/mod_instaweb.cc(465): [client 108.90.150.61] Request not rewritten because: ModPagespeed off, referer: http://birthdaysextreme.net/shopping_cart.html
[Sun Jun 16 00:30:27 2013][debug] net/instaweb/apache/mod_instaweb.cc(375): [client 66.249.72.50] ModPagespeed OutputFilter called for request /index.php?main_page=index&cPath=1_42
[Sun Jun 16 00:30:27 2013][debug] net/instaweb/apache/mod_instaweb.cc(465): [client 66.249.72.50] Request not rewritten because: ModPagespeed off
[Sun Jun 16 00:30:57 2013][debug] net/instaweb/apache/mod_instaweb.cc(375): [client 205.178.182.165] ModPagespeed OutputFilter called for request /index.php?main_page=index&cPath=4_124
[Sun Jun 16 00:30:57 2013][debug] net/instaweb/apache/mod_instaweb.cc(465): [client 205.178.182.165] Request not rewritten because: ModPagespeed off
[Sun Jun 16 00:31:40 2013][debug] net/instaweb/apache/mod_instaweb.cc(375): [client 123.243.113.175] ModPagespeed OutputFilter called for request /index.php?main_page=contact_us, referer: http://www.birthdaysextreme.com/inde...ba36a8faee0abb
[Sun Jun 16 00:31:40 2013][debug] net/instaweb/apache/mod_instaweb.cc(465): [client 123.243.113.175] Request not rewritten because: ModPagespeed off, referer: http://www.birthdaysextreme.com/inde...ba36a8faee0abb
[Sun Jun 16 00:32:43 2013][error] [client 66.249.72.38] Premature end of script headers: index.php
[Sun Jun 16 00:32:43 2013][debug] net/instaweb/apache/mod_instaweb.cc(375): [client 66.249.72.38] ModPagespeed OutputFilter called for request /data/templates/http-errors/Error-500.htm
[Sun Jun 16 00:32:43 2013][debug] net/instaweb/apache/mod_instaweb.cc(396): [client 66.249.72.38] Request not rewritten because: request->status != 200 (was 500)
That path does not look right. It should be the relative Web Site path... (matches DIR_WS_CATALOG in configure.php).
It appears your DIR_WS_CATALOG is "/". If this is the case you can comment out the RewriteBase directive. Otherwise replace the "/" with the value configured inside your configure.php for DIR_WS_CATALOG.
Code:...
###############################################################################
# Common directives
###############################################################################
# NOTE: Replace /shop/ with the relative web path of your catalog in the "Rewrite Base" line below:
Options +FollowSymLinks
RewriteEngine on
#RewriteBase /shop/
###############################################################################
# Start Ultimate SEO URLs
###############################################################################
...
The instance in the configure.php file that I find in my "includes" directory with the location of the relative path that you indicate is below:
define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');
so does that mean the I replace "RewriteBase /shop/" with "RewriteBase /pub/" in the htaccess file?
What I was using is the Real path that is indicated in the zc installation. I was very confused what I was supposed to enter there. So What I did was enter the "define('DIR_FS_CATALOG', '..........' ) to replace "shop/"
You can read more about the different defines in Zen Cart's configure.php. DIR_WS_CATALOG is the "folder" or "directory" where you installed Zen Cart relative to the Web Server's document root (or in other words what shows up following the domain name in your web browser's address bar). Note DIR_WS_CATALOG should start and end with a slash (/).
So if you have define('DIR_WS_CATALOG', '/'), then use either use: "RewriteBase /" or "#RewriteBase /".
If you have define('DIR_WS_CATALOG', '/shop/'), then use: "RewriteBase /shop/".
Glad you were able to get everything working! Thank you for taking the time to reply and confirm the issue was due to a misconfiguration of the ".htaccess" file and not an issue with Ultimate (SEO) URLs.
Note: you previously said "define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');".
"define('DIR_WS_DOWNLOAD_PUBLIC',...);" and "define('DIR_WS_CATALOG',...);" are not the same.
I'm having a problem where the file used for the Recover Cart Sales module, in the root folder, is getting a 301 redirect to index.php. How do I stop this module from rewriting that file?
Some important things to understand about this plugin.
- Ultimate (SEO) URLs will not modify the generated URL or respond to requests for any files or directories which physically exist.
- Ultimate (SEO) URLs does not modify the generated URLs for the Zen Cart "admin".
- Ultimate (SEO) URLs will only modify the generated URL on the "customer facing" for the specific pages entered in the configuration for "Enter pages to allow rewrite".
The Recover Cart Sales module only makes modifications (and adds files) to the "admin" side of Zen Cart. So if you are seeing any 301 redirect... This is unrelated to the current version of Ultimate (SEO) URLs.
Some places you can look: Review your installation of the "Recover Cart Sales" module. Make sure you have the latest version of "Ultimate (SEO) URLs" installed. Review any modifications made to core Zen Cart files. Review any custom redirects added to the .htaccess file in the web server's document root, the ZenCart installation folder, and the Zen Cart admin folder. Review any Zen Cart debug logs and your web server error logs.
How to change apache rewrite to nginx rewrite?
My serverinfo: debian6+nginx+mysql+php
First change the appropriate line(s) in the sample .htaccess file (especially the RewriteBase). You can then try the tool over at Winginx to convert your .htaccess to the nginix format. No guarantee, but it should give you a good starting point.
Thanks for the replies. I'm not familiar with nginx. What is the reason for that instead of a regular htaccess file?
Thanks for the clarifications. My mistake on the plugin, it's actually Autoresponder+, which does put one file in the store root to run via a cron job.
I checked the module installation and found no errors.
I removed all other code from the .htaccess file.
Still, the file is redirecting.
Oddly enough, I had created a custom landing page for one of the products, saved that in the root and that file does not redirect. Both have .php extensions, so that's not part of the problem.
When I turn the module off in the admin, it takes a few minutes before it takes effect, but it does go off and then the redirect problem stops. The file loads just as it should.
Other ideas or places to look?
Oh, no files in the /logs/ directory to look for clues.
Ahhh, quite a different plugin. Autoresponder+ was not created as a Zen Cart "page" (but it still calls includes/application_top.php which in turn loads core portions of Zen Cart including the "automatic redirect" code).
You have a couple options...
- Disable "automatic redirects" (remember Zen Cart generates working canonicals).
- Modify Autoresponder+ to be a Zen Cart "page" (can be easily excluded from the pages to be rewritten).
- Modify the "automatic redirect" code to skip redirecting if the request matches "autoresponder.php".
- Wait for the massive rewrite of this module (which includes changes to the automatic redirect code). There is no ETA at this time.
If you want to modify the "automatic redirect" code,
Starting at line 1320 of "/includes/classes/seo.url.php" change:
to something like:PHP Code:
function need_redirect() {
$this->need_redirect = false;
// If we are in the admin we should never redirect
PHP Code:
function need_redirect() {
$this->need_redirect = false;
if($_SERVER['REQUEST_URI '] == 'autoresponder.php') return false;
// If we are in the admin we should never redirect
Ahhh, the source of the problem!
I opted for your option 3. There is a second file, a data feed for ShopMania, with the same problem. But it has the same symptoms...not a Zen Cart 'page' and was using includes/application_top.php.
I added the code (duplicating the line and using one file name on each line:
if($_SERVER['REQUEST_URI '] == 'file_name_one.php') return false;
if($_SERVER['REQUEST_URI '] == 'file-name-two.php') return false;
but it's still redirecting to the home page. Is the code as I added it correct?
Space removed, on both, but redirect still happening. I thought we had it that time.
Turns out all that was needed was a /.
if($_SERVER['REQUEST_URI'] == '/file_name_one.php') return false;
Did the trick
Thanks for the help. I would not have figured that out on my own.
Hi..
I have just upload the Ultimate SEO URL V2.212
It display the msg as following:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
################################################################################ ################################################################################ ##################################################___
Can you advice? I hope to have solution asap... :-(
Thank you.
Please Answer the following:
Version of Zen Cart?
Version of Ultimate (SEO) URLs? 2.212
Copy of .htaccess file?
Copy of server error log?
Copy of any Zen Cart debug file(s)?
Typically "HTTP/500 Internal Server Error (or Internal Application Error), indicates a SERVER ERROR (either Apache/IIS, PHP, or another server module). This is a generic error telling you the Web Server itself encountered a fatal error in one of the Web Server's modules. Typical causes are: misconfiguration of the webserver, misconfiguration of directives in the .htaccess file, or the webserver not allowing a directive in the .htaccess. There should be a "log" for server side errors (unless disabled by your hosting provider).
Thank You for reporting by following the instructions in step 3 of the readme and inside the .htaccess file you were able to get up and running.
P.S. The name of this plugin is not SEO Urls.
Please use the either the full name: Ultimate (SEO) URLs or the short name: Ultimate URLs to avoid confusion.
Thank You!
I am updating site to 1.5.1 (in a testsite) and have also updated the Ultimate SEO from 2.110 to 2.212 and the only change that I cannot replicate is before on our site we have the setting Add category parent to begining of URLs? as true which writes the categories as subdirectories as well but on the new version the parent directory is not added eg it was http://www.oddballs.co.uk/special-de...1771_1799.html but now it goes to http://www.oddballs.co.uk/unicycle-d...1771_1799.html and the parent is removed (with setting on original), and the product is just produced on its own eg http://www.oddballs.co.uk/indy-train...al-p-3227.html.
I cannot reproduce these exactly as the option changing the format from original to parent will leave the product having its own page as before it would be http://www.oddballs.co.uk/indy-train...al-p-3227.html but leaving the option changed to parent makes the product http://www.oddballs.co.uk/unicycle-d...al-p-3227.html
So is it possible to reproduce this as before or will it best to change to original and then the old links with go to the new ones
The "Add category parent to beginning of URLs?" option in Ultimate (SEO) URLs NEVER enabled categories as directories (as far as I know - I've checked 2.108, 2.109, and 2.110). Versions > 2.150 do include an additional option to use categories as directories (called "Categories as directories").
Are you sure you had an unmodified version of Ultimate (SEO) URLs 2.110 installed (not a different URL plugin such as Simple SEO URLs installed)? If you had something else (or a modified version) installed... You can either use one of the formats supported by Ultimate (SEO) URLs and change over to new URLs (using the canonical and 301 redirects)... Or you can look at CEON URI Mapping (allows you to specify by hand each and every URL on a per category / product basis)...
In version 2.110, enabling "Add category parent to beginning of URLs?" simply added the immediate parent categories name (if any) to the name of the product and the name of the category. So they looked like:
"/parent-category-name-selected-category-name-c-1_4.html" and "/parent-category-name-selected-product-name-p-2.html".
in the above examples "parent-category-name" is the parent category's name, "selected-category-name" is the selected category's name, and "selected-product-name" is the selected product's name.
This can be duplicated exactly in the current version of Ultimate (SEO) URLs by setting "Categories as directories" to "none / disabled", "Format of rewritten URLs" to "parent / enable parent", and "Rewritten URLs end with" to ".html".
If you want to change the behavior so categories will be used as directories you can set "Categories as directories" to "short" or "full".
Did you completely remove both the file changes and database changes (including related configuration settings) for the plugin previously installed on Zen Cart 1.3? Before attempting to install the latest version of Ultimate (SEO) URLs on Zen Cart 1.5.1?
P.S. I am working on version 3.x of this module... The code changes will remove 99.9% of the original code base (and include numerous performance enhancements, changed options, and a new underlying engine)... Any suggestions for improvement are welcome!
Looking though the files it seems that ours was modified version of 2.110 as it does do its own rewrites on the categories / products
The new version is working exactly as it is supposed to do all I was wondering is it possible to have a Hybrid option in the Format of rewritten URLS
Categories: parent-category-name-c-34 (as Parent option)
Products: product-name-p-54 (as Original option)
As this is what our site is replicating. If not then I will have to choose either Original or Product option and then the old links will be re-written to the new ones anyway
The only thing that I didn't do was to remove the files (didn't bother as when the installation occurred it told me the 3 files to delete from the old version that was not used anymore + the new autoloader) and a database removal. The new version is working well without doing these
You could modify the code... Take a peak at the function "get_product_name()" in the class file. This is what pulls the product name from the database. You can probably comment out the two blocks which deal with the 'parent' format (before the comment "//Add the category"). This should disable the parent category from being added to the product.
Hi,
How can I redirect the following link "mysite.com/shop/index.php?main_page=index" to "mysite.com/shop/products_all.html" .
I've already tried "Redirect 301 /shop/ http://mysite.com/shop/products_all.html" and Redirect 301 /shop/index.php?main_page=indexhttp://mysite.com/shop/products_all.html but it's not working.
I've installed the Ultimate SEO modul and it's working well.
Thanks in advance for the help.
One cannot use the Apache "Redirect" directive to handle redirecting based upon query terms (or the lack of query terms). One must instead use Apache "RewriteCond" and "RewriteRule" directives to match based upon the query terms (stuff after the ? in the URL).
But before you go researching how to use redirect a URL containing query terms... There are a few things you may want to ponder... What business purpose does redirecting the website root to the "all products" page serve? How does adding an unnecessary 301 redirect impact the site? (in terms of complexity, performance, and maintenance? In terms of page load time? In terms of SEO?) Why not just adjust Zen Cart's landing page to match your needs?
Just for anyone else reading this thread later... Having Ultimate (SEO) URLs installed has no impact on the answer to this question. The answer is specific to the Apache web server and any website being hosted on an Apache web server. The Apache documentation for mod_alias and mod_rewrite contain more information on directives specific to redirecting and rewriting URLs.
Thanks for your advice.
I know it's not a good solution, but I couldn't set up the dinamic filter on the home page however this modul is working fine on the All products page and that's why I've thought to try it with redirection.
Hello, I haven't used this plugin before so I'm not familiar with it. I have a clean zencart insall with a template and the only other plugin so far is the MSRP. My question is, I am only using the dedicated IP at this time as I will not be moving my domain until after I finish getting this site ready. Would it matter if I installed this plugin while still using the dedicated IP or would it be better to wait until after I have pointed the domain name to it?
Thanks for any suggestions,
Jim
The server name being an IP versus a domain name should not affect this module directly... However some Zen Cart users have reported issues in general when not using a domain name (unrelated to this plugin)... There are some ways to tell just your computer to assign a name to a specific IP address to avoid using an IP address directly... Are you testing on a "local" environment (WampServer, Xampp, Mamp, etc)? Or are you testing on a hosted server (with internet access)?
If you decide to use Ultimate (SEO) URLs, keep in mind the category and product "titles" are placed in the URLs (and typically used in h1 tags by most themes). You will want to make sure these "titles" reflect accurately what you want visitors (and SEs) to see. You can use filters to manually "change" what is placed in the URLs - but it takes a bit of work at this time - so best to think about this early in the process.
General Advice (website development and testing)
My advice when it comes to installing, configuring, customizing, modifying, and / or preparing any content for the internet: First set up the software (or updates) in a "development" or "testing" location (not indexed by Search Engines - or - viewable to the general public). Once you have the site (or changes) ready for general consumption (and of course tested), then migrate (copy) the changes to the live website / location (and re-test).
General Advice (some potential impacts of changing URLs)
As your website does not sound to already be "well established" on Search Engines (SEs)... This is a good time for you to pick your URL scheme (always better to avoid ever needing a 301 redirect). If you plan at launch to use Ultimate (SEO) URLs, I would install the plugin on a "development" copy of your Zen Cart installation. This will let you see the direct impact of your "titles" and also play around with filters (such as having USU convert " in titles to in / inch / inches in URLs).
One can install Ultimate URLs at a later date (or disable the module if installed). Ultimate URLs will automatically handle adding a "canonical" page reference for search engines (unless your theme disables this head tag). This allows search engines to access your pages at either the standard Zen Cart URLs or the URLs generated by this plugin. The "canonical" head tag also lets SEs know the two pages should be treated as the same page (most SEs will also combines the two pages in the search engine index and treats them as one URL).
Ultimate URLs does also have an option to enable "automatic redirects" to issue 301s to aid in switching from the stock Zen Cart URLs (will tell the SEs to use the new URLs as the main URL and send visitors to only the new URL). But keep in mind (at the time this was written) most SEO experts agree well established URLs in Search Engines may take a 1-3% hit if a 301 redirect is issued.
General Advice (website development and testing)
I always setup my test sites as a subdomain. This way the behavior on the dev site is the same as if it was your "live" top level domain.. This will require few to zero changes to modify things such as URL paths, etc..
Hi friends,i really met a big problem for my site:
It worked perfectly on my zencart 1.51 site,but with the increase of the products,i could not open the main page and admin page right now,it reminds me error message,when i checked the log file,i found the following information:
[02-Aug-2013 10:31:14] PHP Fatal error: 1153:Got a packet bigger than 'max_allowed_packet' bytes :: INSERT INTO seo_cache (cache_id, cache_language_id, cache_name, cache_data, cache_global, cache_gzip, cache_method, cache_date, cache_expires) VALUES ('ca34fbe5f9a075091ad59abf02c259a7', '1', 'seo_urls_v2_products'
The problem now is i could not change the max_allowed_packet bytes,even i changed it,the problem will happen again with the increase of the products,anymore have cure on this, i really appreciate your help,thanks
Background:
There are tradeoffs involved with caching (and with different caching mechanisms). There is no one "perfect" setting for all environments and stores. Some of the many factors include: your HTTP/HTTPS server settings, PHP settings, MySQL server settings, network / bandwidth limitations, the size of your database, available processing power, available memory, and desired site performance.
With this in mind, the ability of "Ultimate (SEO) URLs" to use multiple different caching mechanisms both internal and external (as well as disabling all supported cache mechanisms) can be configured. You can choose which to enable based upon the hosting environment and needs of an individual store.
Externally, this module will attempt to utilize and configured Zen Cart caching mechanisms if enabled in Zen Cart. There are two main types in Zen Cart 1.5.1. The first stores answers to the SQL requests in a file or an additional table in the database (is used across requests). The second is query cache which stores requests in memory (only for the current request). I will not discuss these further in this thread, but wanted to mention these will be used if configured globally for Zen Cart 1.5.1.
Internally, this module uses two different caching mechanisms if enabled. The first layer stores the result of generating the URL into memory (only for the current request). The second layer (where it sounds like you are running into issues) stores a compressed copy of entire blocks of generated URL results (such as products, categories, OR ez-pages). This second cache stores the data in the database and is used across multiple requests. Both layers can be enabled or disabled by changing this module's settings.
I've listed a couple of different items you may wish to experiment with when trying to find the settings which work best for your specific hosting environment and store needs.
Change the compression level:
By default this module only uses compression level 1 (on a scale from 0 = none to 9 = max). If your server can handle higher levels of compression w/o a large impact, you can try using higher levels of compression. To change the compression level find the "save_cache" function and bump the level up.
Disable the internal products SQL cache:
You can disable this plugin's internal product SQL cache (as this stores every product name into a single entry in the database). Other cache mechanisms will remain active. This will avoid attempting to cache a large number of generated URL fragments using a single SQL command.
Disable the internal cache completely:
You can disable all internal caches, both memory and SQL based, by setting "Enable cache (globally)" to true. This will leave any external cache mechanisms active. A little extreme and probably not necessary unless the server is getting hammered and exceeding memory limits.
Experiment with an external Zen Cart cache:
You can enable or disable these in your Zen Cart configure.php files. More information can be found by searching the forums and faqs on http://www.zen-cart.com/. This typically is used by Zen Cart to store longer running SQL commands. This module uses the cache if enabled to store requests (can reduce the number of executed SQL JOINS).
Change the settings for MySQL (server and client):
MySQL can typically handle a packet size up to 1G (one would need to modify both the MySQL client and server settings). This is only an option if you have access to change server settings and have enough memory available to the server(s). I would not necessarily bump all the way up to 1G, but you could try 32M, 64M, or even 128M. Performance impact(s) will vary depending upon if MySQL is talking locally or remotely.
Configure other caching:
For a very large site (or site running on a cluster), it may be beneficial to configure separate caches (via proxy, memcached, etc). This is not something simple to set up, but for VERY busy websites the benefit may outweigh the costs. Changes to enable such as setup are outside the scope of this thread.
Thanks for your reply,but i am really new here,i don't know how to make the changes,when i open the website,it only remind me"WARNING: An Error occurred, please refresh the page and try again",how should i disable the cache per your information? i have modified the following links from init_seo_config.php,i am doing right,but still not working for me,what should i do?
return array(
'USU_VERSION' => array('configuration_value' => '\'' . $version . '\'', 'use_function' => '', 'set_function' => 'zen_cfg_select_option(array(\\\'' . $version . '\\\'),'),
'SEO_ENABLED' => array('configuration_value' => 'false', 'use_function' => '', 'set_function' => 'zen_cfg_select_option(array(\\\'true\\\', \\\'false\\\'),'),
'SEO_URL_CPATH' => array('configuration_value' => 'auto', 'use_function' => 'usu_check_cpath_option', 'set_function' => 'zen_cfg_select_option(array(\\\'enable-auto\\\', \\\'disable\\\'),'),
'SEO_URL_END' => array('configuration_value' => '.html', 'use_function' => '', 'set_function' => ''),
'SEO_URL_FORMAT' => array('configuration_value' => 'original', 'use_function' => 'usu_check_url_format_option', 'set_function' => 'zen_cfg_select_option(array(\\\'enable-original\\\', \\\'enable-parent\\\'),'),
'SEO_URL_CATEGORY_DIR' => array('configuration_value' => 'short', 'use_function' => 'usu_check_category_dir_option', 'set_function' => 'zen_cfg_select_option(array(\\\'disable\\\', \\\'enable-short\\\', \\\'enable-full\\\'),'),
'SEO_URLS_FILTER_PCRE' => array('configuration_value' => '', 'use_function' => '', 'set_function' => ''),
'SEO_URLS_FILTER_CHARS' => array('configuration_value' => '', 'use_function' => '', 'set_function' => ''),
'SEO_URLS_REMOVE_CHARS' => array('configuration_value' => 'punctuation', 'use_function' => 'usu_check_remove_chars_option', 'set_function' => 'zen_cfg_select_option(array(\\\'enable-non-alphanumerical\\\', \\\'enable-punctuation\\\'),'),
'SEO_URLS_FILTER_SHORT_WORDS' => array('configuration_value' => '0', 'use_function' => '', 'set_function' => ''),
'SEO_URLS_ONLY_IN' => array('configuration_value' => 'index, product_info, product_music_info, document_general_info, document_product_info, product_free_shipping_info, products_new, products_all, shopping_cart, featured_products, specials, contact_us, conditions, privacy, reviews, shippinginfo, faqs_all, site_map, gv_faq, discount_coupon, page, page_2, page_3, page_4', 'use_function' => '', 'set_function' => ''),
'SEO_REWRITE_TYPE' => array('configuration_value' => 'rewrite', 'use_function' => '', 'set_function' => 'zen_cfg_select_option(array(\\\'rewrite\\\'),'),
'SEO_USE_REDIRECT' => array('configuration_value' => 'false', 'use_function' => '', 'set_function' => 'zen_cfg_select_option(array(\\\'true\\\', \\\'false\\\'),'),
'SEO_USE_CACHE_GLOBAL' => array('configuration_value' => 'false', 'use_function' => 'usu_check_cache_options', 'set_function' => 'zen_cfg_select_option(array(\\\'enable\\\', \\\'disable\\\'),'),
'SEO_USE_CACHE_PRODUCTS' => array('configuration_value' => 'false', 'use_function' => 'usu_check_cache_options', 'set_function' => 'zen_cfg_select_option(array(\\\'enable-products\\\', \\\'disable-products\\\'),'),
'SEO_USE_CACHE_CATEGORIES' => array('configuration_value' => 'false', 'use_function' => 'usu_check_cache_options', 'set_function' => 'zen_cfg_select_option(array(\\\'enable-categories\\\', \\\'disable-categories\\\'),'),
'SEO_USE_CACHE_MANUFACTURERS' => array('configuration_value' => 'false', 'use_function' => 'usu_check_cache_options', 'set_function' => 'zen_cfg_select_option(array(\\\'enable-manufacturers\\\', \\\'disable-manufacturers\\\'),'),
'SEO_USE_CACHE_EZ_PAGES' => array('configuration_value' => 'false', 'use_function' => 'usu_check_cache_options', 'set_function' => 'zen_cfg_select_option(array(\\\'enable-ez_pages\\\', \\\'disable-ez_pages\\\'),'),
'SEO_URLS_CACHE_RESET' => array('configuration_value' => 'false', 'use_function' => 'usu_reset_cache_data', 'set_function' => 'zen_cfg_select_option(array(\\\'true\\\', \\\'false\\\'),'),
);
to be more specific:
Change the compression level:
By default this module only uses compression level 1 (on a scale from 0 = none to 9 = max). If your server can handle higher levels of compression w/o a large impact, you can try using higher levels of compression. To change the compression level find the "save_cache" function and bump the level up.===
=====My question,which file shall i modify?
Disable the internal products SQL cache:
You can disable this plugin's internal product SQL cache (as this stores every product name into a single entry in the database). Other cache mechanisms will remain active. This will avoid attempting to cache a large number of generated URL fragments using a single SQL command.
====Which file shall i modify?
Disable the internal cache completely:
You can disable all internal caches, both memory and SQL based, by setting "Enable cache (globally)" to true. This will leave any external cache mechanisms active. A little extreme and probably not necessary unless the server is getting hammered and exceeding memory limits.
===Which file shall i modify?
please save my ###### out of here!
This can be found by doing a file search. If you have to ask... Better you do not attempt.
You configure this using the Zen Cart admin (configure -> Ultimate (SEO) URLs). DO NOT TRY TO MANUALLY EDIT FILES.
You configure this using the Zen Cart admin (configure -> Ultimate (SEO) URLs). DO NOT TRY TO MANUALLY EDIT FILES.
================
Thank you very much for your reply,the problem is i could not login in admin page because it show erros,anyway,when i use the older version of SEO URL,it working as a magic,i don't know the reason,but i still get the following issue when i check the log,would be appreciate if you could provide more help,which file i could modify to eliminate this problem? thank you.
[06-Aug-2013 14:41:00] PHP Warning: preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Empty regular expression in /home/techeboo/public_html/includes/classes/seo.url.php on line 803
It sounds like you have been trying to just muck around changing files... And may have just overwritten files which are part of this plugin (or Zen Cart) with copies from different versions. This will get you into trouble. Zen Cart is not just files - it is files + a database. Both the database and files need to be in sync for everything to work correctly - and this applies to plugins as well. In the long run thinking you can just "change files" and ignoring the database will lead to a large number of potential issues. You need to take both into consideration.
You should also NOT just start editing files which are part of the plugin to TRY to change stuff in the database. This can break the plugin and installer. Modifying things without knowing the ramifications can be disastrous. If you need to alter the database (and understand the ramifications of every change you make) you should directly edit the database using a tool such as phpMyAdmin.
It also sounds like you may have some invalid configuration settings for this module (possibly from mixing versions, changes you made to the installer, or changes made from the admin interface). The best long term solution is to completely remove this plugin and re-install.
First and foremost, did you install "Ultimate (SEO) URLs"? or some other "SEO URL" add-on. I ask because when people try to shorten the name of an add-on... Well lets just say there are at least three different add-ons which modify the URLs generated by Zen Cart people incorrectly refer to as "SEO URL".
Start by reverting your site to "known good" backup (files and database). Now verify you can get into the admin and also view the site. You should be able to unless there were problems which existed prior to attempting to install this plugin.
If for some reason you did not follow the instructions to make a backup of the files and database for Zen Cart... You will need to find and remove all files and database changes made by ALL versions of this plugin (and any added by changes you made to the installer). As you have been copying files from various versions (and probably breaking some of the upgrade scripts) you may need to do this by HAND.
Once everything is back to a VERIFIED working status (with ALL traces of this plugin removed)... Follow the instructions to install this plugin again. Do NOT take any shortcuts. Do NOT skip anything. Note any and all installation messages...
Thank you,i did not modify the files and follow all the instructions to install the latest version for SEO URL,I did not install any other SEO plugin,it worked good for me before,but when the qty of the products increase it suddenly went down and both the main page and admin page could not be opened,so that's why i want to make some changes on the file,but i did not make any changes.
I did not remove the latest SEO URL,i just the older version for SEO url to replace the exting new SEO url file,because the error reminds me there is something wrong in seo.url.php on line 803 ,so i am wondering if i could simply modify seo.url.php to solve the problem?
You cannot say you modified files (post #444)... Wanted to know what additional files to change to alter settings (post #445)... Replaced individual files with files from a different version (post #449)... All of these conflict directly with the statement "I did not modify the files".
Selectively grabbing parts from one version and mixing with another version will result in issues and errors. This "cherry picking" you have been doing results in the FILES and DATABASE parts of Ultimate (SEO) URLs being out of sync. This is probably 90% of your problem.
If you upgraded from a version of this plugin prior to v2.150, did you first completely remove the old version? Failure to first remove old (and unsupported) versions of this plugin before "upgrading" can also result in things not quite working correctly.
What leads you to conclude this? The error you reported shows either: A) You have an invalid setting (settings for Ultimate URLs are stored in the Zen Cart database). B) You have mixed different versions of the FILES and DATABASE for this module.
At this point the fix is to re-install Ultimate (SEO) URLs from scratch. Please stop trying to find a "shortcut".
Good. Restore your files and database from the backup you made (Making a backup is the first step listed in the instructions for installing this module). Now go back through the files and database and uninstall / remove any files or database entries from older versions of this plugin.
Once all the traces of this (or other alternate URL generators) have been removed, download a CLEAN zip file of this plugin. Unpack the CLEAN zip file to a NEW folder. Start the installation process again using the files and instructions in the NEW folder.
Note: I will not be responding to any further posts from you until: A) You have shown you have followed the instructions I've given. B) You are not trying to take "shortcuts". C) You apologize for continuing to call this plugin "SEO URLs" after being asked not to.
Hi all,
I've been using Ultimate SEO for a while now and now and I am finally happy with it after figuring out how to configure it to my needs. I have recently added directory-based language differentiation for SEO and clarification (since I have both Dutch and English versions of all pages), and I am trying to correctly inform search engines about the different forms of my pages in the different languages, using 'canonical' and 'hreflang' in common/html_header.php
On fixed-url pages this works perfectly how I want it:
However, on product- and category pages I cannot notify about any other language pages than the active language:HTML Code:<link rel="canonical" href="http://art.horisense.com/en/" />
<link rel="alternate" href="http://art.horisense.com/" hreflang="x-default" />
<link rel="alternate" href="http://art.horisense.com/nl/" hreflang="nl" />
<link rel="alternate" href="http://art.horisense.com/en/" hreflang="en" />
This is because the 'zen_href_link' and $seo_urls->href_link functions do not have a language choice. I even tried changing $_SESSION['language'], $_SESSION['language_code'], $_SESSION['language_id'] and reconstructing $seo_urls with the other language id, but zen_href_link still kept giving the url with the active language only. It seems the only way is to completely reinitialize all language-specific constants.HTML Code:<link rel="canonical" href="http://art.horisense.com/en/canvas-c-8/canvas-40x30-pastel-poppy-dancer-p-31.html " />
<link rel="alternate" href="http://art.horisense.com/-p-31" hreflang="x-default" />
<link rel="alternate" href="http://art.horisense.com/en/canvas-c-8/canvas-40x30-pastel-poppy-dancer-p-31.html" hreflang="en" />
Any ideas on the best way to get the page url from another language than the active one?
Nice. Please consider contributing your changes! If you send them my way (PM or EMAIL) I will look over them further and consider them for inclusion in a future version :smile:
If you turn off "automatic redirects", you can use something like the following:
If you installed the "Multilingual Ez-Pages" mod, you will need to change the code on line 652 and 930 of 'seo_url.php' to replace (int)$_SESSION['languages_id'] with $this->languages_id. This only affects generating alternate URLs for a language other than the current language.Code:$tmp_lng = new language();
foreach($tmp_lng->catalog_languages as $lng) {
// Initialize a new generator for a specific language (by language_id).
${'usu_' . $lng['code']} = new SEO_URL($lng['id']);
// Create a link using the generator for a specific language (make sure to define $excludeParams).
${'link_' . $lng['code']} = ${'usu_' . $lng['code']}->href_link($current_page, zen_get_all_get_params($excludeParams), $request_type, false);
// Alternate available for the specified language.
if(${'link_' . $lng['code']} !== null) {
// Do something with the link (such as add an alternate).
}
unset(${'usu_' . $lng['code']}, ${'link_' . $lng['code']});
}
unset($tml_lng, $lng);
I can't guarantee compatibility with other settings and plugins though, but it mainly involves adding this to .htaccess before the start of the Ultimate SEO rewrite rules:
and in functions/html_output.php change:PHP Code:
RewriteRule ^(en|nl)/(.*)$ $2?language=$1 [QSA,L]
toPHP Code:
$href_link = $seo_urls->href_link($page, $parameters, $connection, $add_session_id, $static, $use_dir_ws_catalog);
PHP Code:
// adds the current language as a directory to all links,
if (isset($_SESSION['languages_code'])){
$language_tag_content=$_SESSION['languages_code'];
}else{
// if no $_SESSION['languages_code'] parameter is found, the default language is added to all links:
$language_tag_content=DEFAULT_LANGUAGE;
}
// give preference over language code in the language variable
// the language GET variable is extracted and removed in case a language parameter is present in the url
// (which is the normal case since .htaccess converts the language directory into a language GET variable):
if (strstr($parameters,'language=')){
$language_pos = strrpos ( $parameters , 'language=');
$language_code_pos = $language_pos + 9;
$language_tag_content = substr ( $parameters , $language_code_pos ,2 );
// remove language tag from parameters:
$parameters = substr ( $parameters , 0 , $language_pos) . substr ( $parameters , $language_pos+11);
}
// generate the link without language parameter:
$href_link = $seo_urls->href_link($page, $parameters, $connection, $add_session_id, $static, $use_dir_ws_catalog);
if($href_link === null) {
$href_link = original_zen_href_link($page, $parameters, $connection, $add_session_id, $search_engine_safe, $static, $use_dir_ws_catalog);
$href_link = str_replace('%20','+',$href_link);
$href_link = str_replace('&','&',$href_link);
}
// include the language tag content as a directory in the link url. htaccess will convert this into a regular language GET variable
if (strstr($href_link,HTTPS_SERVER.DIR_WS_HTTPS_CATALOG)){
$href_link = HTTPS_SERVER.DIR_WS_HTTPS_CATALOG . $language_tag_content .'/'. substr ( $href_link , strlen(HTTPS_SERVER.DIR_WS_HTTPS_CATALOG));
}else{
if (strstr($href_link,HTTP_SERVER.DIR_WS_CATALOG)){
$href_link = HTTP_SERVER.DIR_WS_CATALOG . $language_tag_content .'/'. substr ( $href_link , strlen(HTTP_SERVER.DIR_WS_CATALOG) );
}
}
Your suggestion was sort of what I tried already and doesn't work.Quote:
If you turn off "automatic redirects", you can use something like the following:
Code:$tmp_lng = new language();
foreach($tmp_lng->catalog_languages as $lng) {
// Initialize a new generator for a specific language (by language_id).
${'usu_' . $lng['code']} = new SEO_URL($lng['id']);
// Create a link using the generator for a specific language (make sure to define $excludeParams).
${'link_' . $lng['code']} = ${'usu_' . $lng['code']}->href_link($current_page, zen_get_all_get_params($excludeParams), $request_type, false);
// Alternate available for the specified language.
if(${'link_' . $lng['code']} !== null) {
// Do something with the link (such as add an alternate).
}
unset(${'usu_' . $lng['code']}, ${'link_' . $lng['code']});
}
unset($tml_lng, $lng);
But I found out that the problem was caused by the cache. If I turn off the seo url cache it works!
And also it was helpful to use this way of looping through the languages in order to find the id and the language code together.
I changed my mind about the default language page btw. I use it also for the social media buttons, to combine the like/share counts for all languages. I thought it would be a good idea to have a very short url, so it leaves more room in tweets. However, on second thought I have now chosen to use a slightly shortened version of the English url for the x-default language page and the social media tweets/shares/likes (regardless of the chosen language):
In this way, I may still at least benefit from the english keywords in the url, when my product url's are shared in tweets.HTML Code:<link rel="canonical" href="http://art.horisense.com/nl/canvas-c-8/canvas-40x30-pastel-papaverdanseres-p-31.html" />
<link rel="alternate" href="http://art.horisense.com/canvas-c-8/canvas-40x30-pastel-poppy-dancer-p-31/" hreflang="x-default" />
<link rel="alternate" href="http://art.horisense.com/nl/canvas-c-8/canvas-40x30-pastel-papaverdanseres-p-31.html" hreflang="nl" />
<link rel="alternate" href="http://art.horisense.com/en/canvas-c-8/canvas-40x30-pastel-poppy-dancer-p-31.html" hreflang="en" />
I used this caching in memory:
andPHP Code:
$this->cache['PRODUCTS'][$pID][$this->languages_id] = $pName;
and so on.PHP Code:
defined('PRODUCT_NAME_' . $pID . '_lng_' . $this->languages_id)
Now I refused to use the constants for caching (strange idea).
And also refused to create a complete in-memory cache every time a class construct. Need to conserve memory.
When you need something - then put in the cache. Cache on demand.
Yup, The in memory caching code is some of the last remaining inherited code. The inherited code works how you mentioned - minus the language (including both in memory storage using constants and storage using an array).
There are three configuration options for the in memory caches... None, array only, array + constant / SQL... I typically enable the array only based in memory cache. In most cases if you need the constant / SQL method you are better off moving to a different hosting environment (or provider).
To disable the constant based memory cache (loads all items into memory when the class is created) disable the "product cache", "manufacturer cache", "category cache", etc. Leave the "global" cache option enabled. Global is not quite the right word, but is the one used in the configuration at this time.
For Mohandas` scenario using only the array based cache (with no other code changes) and disabling "automatic redirects" should work. My snippet earlier was thrown together on a system with only the array cache enabled.
If one wants to enable the larger "constant" based caching mechanism and needs to be able to pull the same URL for different languages... Changes such as those posted by a_berezin will be needed (thank you for posting).
Removing and / or refactoring the existing code handling caching is part of the "todo" list for the next major release. The constant based caches may be disabled by default in the next minor release... And may be removed completely in favor of some alternative methods...
zencart: v1.5.1
USEO: V2.212
Problem: (including all products, new products....)
When set USEO on (ex: domain/products_new.html), the pages were available. However, google (webmaster tools -> fetch as google) shown that the page status was 404, and the firebug said it was 200. If visit the page as domain/index.php?main_page=products_new, there was no issues.
Attachment 12893
I think it may be a .htaccess problem, but I don't understand it. Could anyone help?
Code:###############################################################################
# Common directives
###############################################################################
# NOTE: Replace /shop/ with the relative web path of your catalog in the "Rewrite Base" line below:
#301 redirects
RewriteEngine On
RewriteCond %{HTTP_HOST} ^my domain name [nc]
RewriteRule ^(.*) http://www.my domain name/$1 [R=301,L]
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
#producttags
RewriteRule ^producttags/([-\w]+)/$ index\.php?main_page=producttags&letter=$1&%{QUERY_STRING} [L]
RewriteRule ^producttags/([\w])/([0-9]+).html$ index\.php?main_page=producttags&letter=$1&page=$2&%{QUERY_STRING} [L]
RewriteRule ^wishlist/$ index\.php?main_page=wishlist [L]
RewriteRule ^wishlist/([\w])/$ index\.php?main_page=wishlist&letter=$1&%{QUERY_STRING} [L]
RewriteRule ^wishlist/([\w])/([0-9]+).html$ index\.php?main_page=wishlist&letter=$1&page=$2&%{QUERY_STRING} [L]
# For Open Operations Info Manager
RewriteRule ^(.*)-i-([0-9]+).html$ index\.php?main_page=info_manager&pages_id=$2&%{QUERY_STRING} [L]
###############################################################################
# Start Ultimate SEO URLs
###############################################################################
# Handles the new URL formats
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)/(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$4&cPath=$2&%{QUERY_STRING} [L]
# Original (unchanged) URL formats
RewriteRule ^(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-m-([0-9]+)(.*)$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pi-([0-9]+)(.*)$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pr-([0-9]+)(.*)$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-pri-([0-9]+)(.*)$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-ezp-([0-9]+)(.*)$ index\.php?main_page=page&id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-c-([0-9_]+)(.*)$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
# All other pages
# Don't rewrite real files or directories
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index\.php?main_page=$1&%{QUERY_STRING} [L]
RewriteRule ^news(.*)$ index.php?main_page=news&$1 [E=VAR1:$1,QSA,L]
a_berezin and lhungil thank you so much for the detailed help. Yes it was indeed okay to leave on the global cache when I turned off all the page-specific cache options. As far as I could see in the code, indeed the database cache is differentiating between languages. Language differentiation is just not included in naming the constants nor in $this->cache.
I think I also managed to implement the suggestion by a_berezin to modify the constants and memory cache, by modifying all definitions and queries with respect to PRODUCT_NAME_ AND $this->cache['PRODUCTS'] in the functions 'get_product_name', 'get_product_canonical' and 'generate_products_cache' to include a language id. I now finally get the different language urls even when I turn on product name cache. I will do the same for the categories, etc.
And I guess what a_berezin tried to say is that every time a seo class is constructed, all product names are read from the database and put into memory (constant) cache. This seems quite a lot of unnecessary overhead process and memory since most of the names will not be used.
It seems that, in order to replace that by on demand caching, the function get_product_name will need to not only read the product name from the database if it is not cached yet, but also put in the cache at that moment. Am I correct and is this the only thing that would need to be added when removing 'generate_products_cache()' from class construction? Or would there be more modifications necessary?
I'm sorry that I answer here, in the discussion of the module from lhungil.
Yes, that's exactly what I'm doing. In get_product_name I check whether the name with requested products_id and current language_id in the cache, if not - read from the database and put it in db_cache/Memcache and (optional) in memory cache.
Also I use very simple structure of DB Cache Table:
PHP Code:
$insert_cache_table = "CREATE TABLE " . TABLE_SEO_CACHE . " (
cache_name char(32) NOT NULL,
cache_data text NOT NULL,
cache_created timestamp NOT NULL,
PRIMARY KEY (cache_name),
KEY idx_cache_created (cache_created)
) ENGINE=MyISAM;";
Hi
I have an issue that seems a bit unusual and I was hoping somebody might be able to offer some advice as to what's going on.
I'm trying to install Ultimate SEO onto my development site. Its Zen Cart 1.5.1 and the latest USEO (2.212). No .htaccess file was being used and none of the core zen files had been edited so the install was simple - copy over the amended files, copy over the new files, edit the .htaccess file (RewriteBase / to match the location of Zen which is installed to the root of the domain), upload .htaccess, login and finish the install. The install said it was successful.
If I browse to a category or product page the URL is re-written as I expected but the page takes ages to load and seems to be missing all the styling and scripts. Using the developer tools in Chrome I can see a category page takes 20.6 seconds to load, makes 67 requests and transfers 1.6Mb of data.
As a comparison, the same page on the live site (or the dev site if I disable USEO) takes 1.52 seconds to load, makes 75 requests and transfers 96.5Kb of data.
I'm at a bit of a loss as to what's going on. Has anyone else seen this or have any idea as to what the issue might be?
Thanks in advance!
Tom
Usually indicates something is not working in your template. Do the resources show up correctly in the "classic" template? Have you looked at any 404 errors to determine what may be broken (404 errors cause major load time issues)? Have you tried different cache settings / URL settings? Have you tried a different browser?
The supplied .htaccess file is for Apache mod_rewrite. Your webserver is not running Apache (and thus not using mod_rewrite). The server your website is hosted upon appears to be using LiteSpeed as the WebServer.
Since everything is working from useragents other than "googlebot", this makes me suspect another rule may be configured on the webserver to selectively apply the .htaccess filter based upon useragent.
These are not issues with this plugin, but with your hosting provider (and their compatibility with mod_rewrite). You will want to contact your hosting provider and ask... Why when the user agent is "Googlebot" is their server is not applying the .htaccess filter (and rewrite rules)? Can they "fix" the configuration of their server to correctly apply the .htaccess filter to ALL requests?
Hi lhungil
Thanks for your reply. Things have changed, even the firebug return a 404.(tried a lot, could not remember how made)
Attachment 12904
First, only three pages (new products, all products and featured products) return 404. It looks like the problem was from the page codes. However, if the format of the URL was index.php?main_page=xxx, there was no issues. I think it suggested that, instead of a codes problem, it's a rewrite problem.
Second, checking the .htaccess file, it looks like that the following codes should be respond to charge rewriting index.php?main_page=xxx format URL. However, I have other page with the same URL format, the software page. The software page return 200 in both index.php?main_page=softwae and software.html format.
Totally confused.Code:RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index\.php?main_page=$1&%{} [L]
Only requests with certain "user agents" appear to not be applying the rewrite rules (you can see this at "web-sniffer.net"). This is not an issue with the supplied Apache mod_rewrite rules or this module.
This is most likely a problem with the configuration on the webserver where your website is hosted (or perhaps you have multiple domains sharing a common document root). The best thing you can do is CONTACT THE COMPANY YOU ARE PAYING to host your website and have them find and fix whatever configuration on the server is causing your issue. The company hosting your website will have access to additional logs and additional methods to track down the culprit.
Hi lhungil
Sorry, I have not describe the problem clear and made it confused. Let's focus on my local server (apache 2.4.3, php 5.4.7)
There are 14 links (domain name/xxx.html format) on home page. If SSEO was off, there was no any issue. I think that means that there is no code or structure error on the pages that the 14 links point to. If SSEO was on, 8 pages return the 404 and 6 pages return 200. It looks like some problem in rewriting process. However, instead of loading 404 page, all the pages loaded correctly. Does it mean a 404 was responded before the rewriting process done?
As an example:
Attachment 12917
Thanks lhungil, you are right. The standard template works perfectly so its something to do with the template I'm using. It's the same in Chrome and Firefox. I think I can see where the problem is although I'm still not sure why. The developer tools show all files are found successfully but all the Javascript files are coming back with an error - "Uncaught Syntax Error: Unexpected Token". This is only on the dev site running USEO.
I'll have a look at the files to see if I can figure out what it might be but if you have any pointers or have come across this before it'd be great to know.
Thanks!
A bit of further information, the console also shows:
"Resource interpreted as Script but transferred with MIME type text/html"
"Resource interpreted as Stylesheet but transferred with MIME type text/html"
This only happens with USEO enabled.
I've found a workaround although not fixed the issue. If I hard code the links to the css and js files the site works perfectly.
So its something do do with this bit of code:
Code:<?php echo $template->get_template_dir('',DIR_WS_TEMPLATE, $current_page_base,'jscript').'/bootstrap.js'?>
I am unable to duplicate the issues you appear to be experiencing in a stock Zen Cart 1.5.1 installation with an unmodified version of Ultimate (SEO) URLs 2.212 installed.
Upon further review of your previous posts it appears you have made additional modifications to Zen Cart and this module. These modifications are the most likely cause of the issues you are experiencing.
I would strongly recommend:
- Backup your test environment.
- Uninstall the module providing alternative URLs. This includes removing all new files, modifications made to Zen Cart files, database modifications, and database entries.
- Install an UNMODIFIED version of Ultimate (SEO) URLs. Do NOT merge any changes into this modules "new_files" or ".htacces" file.
- Configure Ulimate (SEO) URLs to fit your needs and re-test.
Thank You for confirming the issue is most likely with the template you have installed.
This module only changes the URLs generated by Zen Cart. It does not modify any resources or the webserver requests / responses. So nothing this module does should result in the issues you are seeing.
It may indicate your template was not installed correctly. Or your tempalte makes assumptions based upon URLs (instead of using Zen Cart functions). Or your template includes code which attempts to "minify", "combine", or otherwise alter JavaScript and CSS resources?
It would also be helpful to know what other "modifications" have been made to the site. It would also be helpful if you could provide a link to the test site so we can "see" what is happening.
Glad you were able to get it working.
Out of curiosity (and for future readers who MAY run into something similiar)... Was there another .htaccess file (or webserver directive) for WordPress somewhere? Or were there some issues with changes made to Zen Cart code (to integrate w/ WordPress) which were causing issues?
Exactly my same question..:smile: (you know I'm a BIG proponent of WordPress integration) because the ONLY issue I know one might run into it when using WOZ or the Numinix Blog Embedding solution without adding the directive to the .htaccess file to prevent the blog folder from being re-written.. If there is another WordPress integration issue, I'd be curious to hear what it is to..
Hi,
I've installed Ultimate SEO URLS V212 on Zen Cart 1.51. The install works fine but the .htaccess file breaks my site completely. I've never had an issue before on my own servers but this site is hosted on Fasthosts and I know I've problems with .htaccess files with them before with other scripts.
Does anyone know how to configure the .htaccess file for Fasthosts servers please?
Thanks in advance
:smile:
Hi everyone. I started getting these very long error messages generated out of the blue. I searched the forum but had trouble finding the problem. I posted this thread, http://www.zen-cart.com/showthread.p...uplicate-entry, and followed the advice - to truncate my zen_seo_cache table. The errors have stopped but the custom URLs are no longer being generated either.
Can anyone help? Thank you.
You might need to "repair" the database table (if damaged can cause issues with entries being added / removed from the table). You can usually "repair" the table from within phpmyadmin. Another alternative (the repair would be better in most cases) is to "drop" the table (remove) and re-install this module (will add the missing table). With a fast database server (without any database consistency errors) this message should be rare.
The "seo_cache" table is only used at this time if one has the individual persistent caches (category, product, ez-pages, manufacturer, etc) turned on. One can always try turning off the persistent caches (the responses will still be cached in non-persistent memory if one has global caching enabled). One may see a performance boost or drop depending upon the hosting environment (web server, PHP, MySQL, etc).
Common reasons the ".htaccess" file fails:
- Corrupted Upload (or Upload client not treating the file as "TEXT").
- A typo when editing (especially w/ RewriteBase).
- A merge gone wrong (something out of place when merging with an existing .htaccess file).
- Web server restrictions (such as not allowing following symbolic links or rewriting).
- A web server which does not understand .htaccess files or has them disabled.
- A hosting provider using RewriteRules instead of NameVirtualHosts to provide shared hosting.
- Nested web server document roots (often using / requiring special RewriteRules).
If you have tested the ".htaccess" file on another server and it works, best advice is to contact Fasthosts (or you can muck around in the web server error logs if they are available to you).
Writing on behalf of a client running ZenCart v1.5.0 and moze.n template. When adding the Ultimate SEO URLs module, the category and product pages are being broken. After much searching, I still cannot pinpoint what is causing it to throw off the layout.
Example can be found at devstore7.ldsstores.com. Click on any product or category page to see what is happening. It seems to be completely disregarding all CSS for menus, sidebars, footer and just about everything else.
I have compared source code between working page and broken page and found no differences of any consequence. Please advise on what more information is needed or how the issue can be resolved. Thank you.
I have a small store, so I am wondering if I can do this:
Instead of:
'http://www.mysite.com/my-category-c-2/my-product-p-7.html
to:
'http://www.mysite.com/my-category/my-product.html
This is not an issue caused by "Ultimate SEO URLs". This does not occur with a stock installation of Zen Cart using the default template. The problems you are experiencing are caused by other modifications which have been made to your Zen Cart installation.
Some notable issues with your site:
- The custom code used to generate the "category menu" on the left is not the standard Zen Cart categories code. The custom code appears to not be using the Zen Cart zen_href_link function. The custom code is generating invalid links and injecting invalid category names into the HTML. All internal Zen Cart links should be created using the built-in Zen Cart function zen_href_link (handles session params, escaping entites such as &, etc).
- Broken javascript code in the template. Getting reported errors in FireBug including "function not found".
- Poorly generated / coded HTML including duplicate attribute ids, failure to escape required characters, improperly nested elements, common optimizations missing, and the list goes on...
- Seeing some "HTTP 406" errors... Often this can be caused by mod_security restrictions... But can also be caused by other issues with "content negotiation". You will want to track down the culprits.
- Alterations have been made to the HTML head section (either the Zen Cart code or the installed template). There are a number of problems with the HTML being generated inside the head element... Most importantly you are defining "relative linked" resources BEFORE the base element. This will cause those resources to be loaded relative to the URL in the browser window instead of relative to the BASE element. Either make those references absolute or move them below the BASE element.
- Many missing / broken images. This slows down accessing the page and will make debugging more painful. Please copy over the images from the live store.
That is just the short list and other issues may be present in your Zen Cart installation...
Note: See http://validator.w3.org/ for a list of errors found in the HTML generated by your theme.
How do I enable the manufacturers to show up with the manufacturersname instead of id.
I am getting this : index.php?main_page=index&manufacturers_id=46
Using version 2.212 and zc 1.51
Adding the manufacturers name (page=index) to the URL is enabled by default. Double check your installation and configuration.
Some basic troubleshooting steps and questions to answer:
- When installing were there any warning or error messages? If so what? If unsure, redo the installation and note any and all messages displayed by Zen Cart. If you did not see any messages... Re-read and follow the installation instructions.
- Is the module enabled? If not may indicate installation failed or the module has not been configured / enabled. Make sure in the configuration menu this module is enabled.
- Are other generated links using the alternate URLs? Are category and product links using the alternate URLs? If not, make sure in the configuration menu 'index' is in the list of pages to alter (rewrite).
- Is there anything in the Zen Cart debug files? Is there anything in the webserver or php error logs (may need to enable depending on where Zen Cart is hosted)?
- What other modifications have been made to Zen Cart? Do they correctly use zen_href_link to generate URLs?
- URL to example website displaying the noted issue(s)?
Hi,
just had an unsuccessful installation of v212 - I think it is possibly (read likely) my fault so I am not upset - I just need some help. I now cannot get to my admin - mydomain/admin/login.php just comes up as a blank page. So I am really stuck here (H-E-L-P)
prior to installing I did a database backup and have restored that original database but still no login page.
Here was my mistake - I manage a number of sites and this particular site I didn't realize I had previously installed this plugin, earlier version, but had disabled it in admin - my stupid fault for not checking first.
Anyway I have now lost access to getting into admin - I tried to do the removal but not being php cluey I didn't know how to comment out so I just deleted that install block - note that I had lost admin access prior to this, just had a page with a database error which I did not copy but it went something like this 'TABLE_ADMIN_PAGES' not found; page key = 'configureSEO' bla bla
REMOVAL INSTRUCTIONS
===========================================================
1. Edit "new_files/your_admin_folder/includes/init_includes/init_seo_config.php" commenting out the install block and uncommenting the
uninstall block.
So I am currently up the proverbial creek without a paddle - any ideas on how I can retrieve admin access?
cheers,
Mike
To comment out the install block: around line 10 you would add a /* to the start of the line and around line 31 you would add a */.
To uncomment the uninstall block: around line 33 remove the /* from the start of the line and around line 50 remove the */.
If this was another Zen Cart 1.3.9x, it will probably be faster and easier to refer to the notes from the PM I sent back in February (I've resent the PM). Let me know how everything goes :)
No problem. Hopefully the information gives you a good starting point.
I'd probably tackle things in this order...
- Fix the location of <base href="" />. Should be before any reference to an external CSS or JScript file - but after then language / content type declarations. This will fix things so the page displays.
- Update the custom category box to use zen_href_link or replace with a plugin (or the stock Zen Cart sidebox) which already uses the function. Without this change unnecessary 301 redirect may take place.
- If after fixing the above you still see any HTTP 406 errors (FireBug or similiar comes in handy here), contact the hosting provider and see if they will look into the errors.
- Time permitting look into fixing the more cosmetic HTML errors (modern browsers can handle most of the other issues without loss of functionality).
Hello,
I'm about to install this on a 1.5 installation that has a non-default them, couple addons, etc.
One newbie question before I go through with it: what's the difference between 'merge' and 'overwrite', as per the install instructions in the readme?
"1a. If you haven't made changes to Zen Cart. Overwrite the files..."
"1b. If you have made changes to your Zen Cart. Merge the files..."
Since I'm running a non-default theme and have some other add-ons installed, I'm assuming I qualify for 1b...
I've compared files/folders between what's on my server and what's in affected_files and there's a handful of existing files...do I overwrite these? e.g. includes > functions > html_output.php already exists on the server, adminfolder > categories.php and product.php, adminfolder > includes > functions > general.php and html_output.php, all exist on the server. Overwrite these with the files from the add-on? Or am I missing something with the reference to 'merge' the files?
Thanks, looking forward to getting this up and running!
Kind regards,
Nathan
Definition of merge. Definition of overwrite.
Basically the files in "affected_files_xxx" are core Zen Cart files (with path) already modified to work with their respective version of Zen Cart. If you have made any changes to these files (and uploaded the changes to your production server), you will need to "merge" your changes with the changes found in these files (best done on a local copy of the site). Once done with any needed file merging, you can simply upload the files (which overwrites the files on the server).
Note: Don't forget to BACKUP your production site before making any modifications. This includes both the database and files.
Hi,
I recently installed the plugin and think I have an issue with configuration as I have received a WMT warning about excessive 'not followed pages', some 214. This is how it is currently configured, straight out of the box - what do I need to change, if anything, or do I ignore the WMT warning?
Attachment 13060
many thanks,
Mike
Alot depends upon what exactly WMT is telling you (and what you find when checking the links). It may also just be false positives from WMT and the warnings may go away after the next crawl). Without being able to see the website (or WMT), here are some things to check...
First, do the URLs being reported by WMT look like they were generated correctly? Can you access the URLs? Was the .htaccess file upgraded with the latest rules (the .htaccess file in the distribution zip)?
This plugin does not affect / alter / create "no follow" tags on pages... Kinda "doubt" this is the issue, but you can check the URLs indicated by WMT for "nofollow" (in the HTML source / HTML headers).
Double check the "canonical" link in the affected page(s). Is there a canonical (if not your theme may be removing it)? Does this match the URL (with automatic redirects on it should match)? If you type in the canonical link are you redirected (should not happen)? If the generated canonical is not correct, make sure the init_canonical override file was installed.
Next thing to check is for a redirection chain. Make sure a request to your site does not incur more than a single 301 redirect. Having more than one can be problematic. If you are seeing two or more... Time to look at the ".htaccess" files and server configurations to ensure they are not adding any "redirect" or "R" flags (this plugin does not add any).
I've also seen some redirect loops in the past (misconfiguration of Zen Cart). These are usually caused by adding a "hostname redirect" inside a ".htaccess" file which does not match the value of "HTTP_SERVER" in "configure.php". So for example when "HTTP_SERVER" is set to "http://domain.com" and in the ".htaccess" file someone has added a redirect to force all traffic to "http://www.domain.com".
If none of these apply, and the site was active for a long time at different URLs... I'd suspect WMT may be warning many URLs are showing a 301 redirect (have changed). Another (rare) possibility would be you are somehow exceeding the 2048 character limit for URLs (unless one has VERY verbose titles with a LARGE number of sub categories, one should not be able reach this length in a stock Zen Cart installation due to database imposed limitations).
Hi
thanks for the detailed response. I marked the not followed urls as 'fixed' in WMT so I can't now check if they could be accessed however there are no more urls reported as not followed yet but it may be too early to call.
I in fact had this exact situation - have now deleted the redirect from http mysite to www mysite. I had it set up initially by my host as I could not access the www. version of the site via the browser for some reason or other - the fix was to use the 301 redirect. I must also admit to being confused about this statement in WMT at the bottom of their information page on 'preferred domain' settings in WMTQuote:
I've also seen some redirect loops in the past (misconfiguration of Zen Cart). These are usually caused by adding a "hostname redirect" inside a ".htaccess" file which does not match the value of "HTTP_SERVER" in "configure.php". So for example when "HTTP_SERVER" is set to "http://domain.com" and in the ".htaccess" file someone has added a redirect to force all traffic to "http://www.domain.com".
not sure how advantageous that is given the dominance of Google - your thoughts on this? - in any case I have now deleted the 301 redirect and will monitor any developments.Quote:
Note: Once you've set your preferred domain, you may want to use a 301 redirect to redirect traffic from your non-preferred domain, so that other search engines and visitors know which version you prefer.
So many thanks again for your assistance - if the problem persists (see a doctor :smile:) I will check the things you have mentioned before I mark the urls as fixed - hopefully it will all just settle down.
cheers,
Mike
Spoke too soon - latest crawl has 178 urls not followed. I have given some examples below. WMT says "Google couldn't follow your URL because it redirected too many times." - the urls cannot be accessed - the browser gives following error message "The page isn't redirecting properly - Firefox has detected that the server is redirecting the request for this address in a way that will never complete. - This problem can sometimes be caused by disabling or refusing to accept cookies."
sample urls - response code is 301 in all cases;
index.php?main_page=index&index_php?main_page=product_info&products_id=116&sort= 20a
index.php?main_page=index&index_php?main_page=product_info&products_id=116
index.php?main_page=index&index_php?main_page=product_info&products_id=528&sort= 20a&page=12
index.php?main_page=index&index_php?main_page=product_info&products_id=528&sort= 2d&page=17&language=en
index.php?main_page=index&index_php?main_page=product_info&products_id=528&sort= 2d&page=17
the .htaccess file is as per the .zip file - it did have the following additional script but I have deleted this as per my previous post;
RewriteCond %{HTTP_HOST} ^dazzlers.net.au$
RewriteRule ^/?$ "http\:\/\/www\.dazzlers\.net\.au\/" [R=301,L]
the same redirect was at the host also in cPanel but that is now deleted also
Ultimate SEO configuration is as per my first post above (untouched)
this I do not understand - what would the canonical link be? configure.php is set to http://mysite . com - * the init_canonical override file IS installedQuote:
Double check the "canonical" link in the affected page(s). Is there a canonical (if not your theme may be removing it)? Does this match the URL (with automatic redirects on it should match)? If you type in the canonical link are you redirected (should not happen)? If the generated canonical is not correct, make sure the init_canonical override file was installed.
The site is working properly and site navigation is fine. So not sure what else you would need to know.
cheers, Mike
Pick which one you prefer. with or without the www prefix. Then be consistent. If you want the prefix make sure it is added to the Zen Cart configuration. If you don't make sure it is not in the Zen Cart configuration. Zen Cart automatically adds the HTTP_SERVER to the start of generated URLs, so SEs will always see the one you set :)
If you really want you can have a "canonical redirect" in the ".htaccess"... But will probably want to exempt "post" requests, pass query terms and the URI, and make sure it redirects to host specified in Zen Cart's "configure.php" files.
Looks like some bad links coming in from somewhere... best to figure out where :)
In WMT when you click on a link in the error list, it pops up a dialog. In the dialog there are some tabs. Click on the "sitemaps" and "linked from" tabs and see if you can narrow down the cause.
Speaking of sitemaps.... The one listed for your site in the "robots.txt"... Does not appear to exist... May want to fix this :)
The canonical links appear to be correct on your site. These are automatically generated by Zen Cart (and USU includes some minor changes so they work with USU). Google WMT has an okay article on the subject. Zen Cart currently generates canonical links for EVERY page. Recommendation from Google (and Bing) is to only set this if the URL differs from the canonical URL (but Google at least seems okay with it being on every page).
hello,
I have a problem with the function in the shoppingcart "Continu shopping". When someone put something in the cart from a categorypage and the clicks the button "continu shopping" and add another product in the cart, the firtst product is now twice in the cart and the last one isn't.
I think it has to do something with the url created after "continu shopping"....the url looks like this http://www.domain.com/onecat/?produc...12431&sort=20a
What can be the problem?