Conor, that was just me being stupid and not knowing what I didn't know (which at this point is still a lot). I'll be a lot more careful to give anyone who's offering to help the full picture.
Printable View
Conor, that was just me being stupid and not knowing what I didn't know (which at this point is still a lot). I'll be a lot more careful to give anyone who's offering to help the full picture.
Hi,
The main thing is that you are up and running now.. and don't worry, we're all learning as we go! :)
All the best...
Conor
ceon
Hi Conor, I just installed Ceon URI Mapping & I updated the URI mapping for all my categories & products; The problem is that it worked fine for the categoties but not for my products; When I click any product on the web site it brings up a white page for that product without any graphics (looks like a text only page);
I'm affraid that it have somthing with the htaccess file; I have it uploaded to /public_html/.htaccess, & here is the 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]
Did I do anything wrong?
Again my problem is only with products not with categories
Hi,
That's not a problem with the URI mapping module I don't think.. you'd get the blank page ALL the time or not at all.
You'll have to enable error reporting on your site and find out what is causing the problem. Search the forum for details on how to do this.
You must have installed something else at the same time as the module or you have adjusted your product info display template and made a mistake in the code.. something other than the URI Mapping module is the source of your problems.
Hope that helps! Please don't post a reply on this thread, start a new thread if you are still having trouble.
All the best...
Conor
ceon
ive just noticed that if you try to add a review to a product that has its url rewriten you just get an error message and cant be writen. page 404 error
thanks for the mod :)
works like a gem!
This is not making any sense to me. This is a great module and I have installed it easily on one zen cart already and worked like a charm, however I am having problems on the 2nd cart.
Both sites are on same server.
Both using Zen Cart 1.3.8a
Both using updated URI mapping 3.2.4.
Both are using same htacces code.
Problems:
1) Admin section configuration not showing button to enable/ disable URI mapping.
2) Urls are NOT being overwritten still showing long path. The database is showing what should be written.
I have even reinstalled zen cart so it is at it's basic form to make sure that nothing is overwritten.
I do not understand why the second cart is not working.
Nevermind my previous post I have figured it out. For some reason the configure and configure_group in the database did not update with URI table information. I just copied those tables from other cart and viola it worked.
But thanks for a great MOD!!!
:flex:
Hi Conor,
just installed your module, work perfectly, even can hadle czech symbols. Great work! Thank you!
Nevertheless I have a question, while going to EZ pages it's throwing
two symbols "?&", see example:
http://www.auto-moto-elektronika.cz/...bku?&chapter=1
Is it the way it should be or there is a fix needed?
The URI for the mentioned EZ page has been generated correctly, i.g. "Katalogy-nasich-vyrobku".
Thanks again.
Regards,
Andy
Can the uri mapper work with russian charset? I tried but russian symbols are transformed to integers(chars are multibyte, and they're transformed to ိ for example), any hints on that?
Hi Andy,
Glad you like the module!
I'm afraid that any query string parameters added are the responsibility of Zen Cart. I can't replicate your problem, but I've seen other sites where "chapter=" has been added on and I don't know why Zen Cart does it.
I'm afraid my only solution is to ignore this, there's nothing I can do about it. :(
All the best...
Conor
ceon
Hi Simon,
That doesn't happen here.. remember the module automatically adds URIs for products with "/add-a-review" as the last part for review pages.
Maybe you've got a problem in your database and the add-a-review URIs aren't linked properly? You'll ahve to manually check the database using PHPMyAdmin, looking to see if there are mappings in place for the product and "add-a-review". Then you should manually debug the reviews_write files to see why they aren't appearing.
That's not an easy process but I'm afraid it's what I'd have to do to find the source of this problem and fix it.
All the best...
Conor
ceon
Hi,
The module has probably the most advanced transliteration capabilities I know of in an open source web project. The code took a full week to research and write and is based on code from other open source projects (as specified in the documentation and appropriate file headers in the code).. however I have not personally tested it against many languages so I don't know how capable it actually is.
It sounds like it can't cope with certain Russian multibyte characters? I find that strange as it copes with Japanese and Czech and Greek characters etc.
Unfortunately if it doesn't work for you there's nothing I can do at this time.. if you have experience in this area, place take a look at the code to see if there's anything I can change to adapt it for the problems you are having and I'll upgrade the code as appropriate.
All the best...
Conor
ceon
Hi Conor, Loter,
why not specify the rule, for example:
A=>А, Б=>B, В=>V, Г=>G, Д=>D, Е=>Е, Ж=>ZH, З=?Z, ........
As far as I know, Ultimate Ceo cannot hadle czech symbols, so there is rule added:
Ě=>E,Š=>S,Č=>C,Ř=>R,Ž=>Z,Ý=>Y,Á=>A,Í=>I,É=>E,Ú=>U,Ů=>U,ě=>e,š=>s,č=>c,ř=>r,ž =>z, ý=>y,á=>a,í=>i,é=>e,ú=>u,ů=>u,ň=>n,ť=>t,´=>
and it is working OK.
Conor, thanks for you reply and feedback regarding my post.
Regards,
Andy
I'll post my successes.. I already reinstalled my test zc with full utf-8 support( I had some troubles switching to Russian in admin). I will install back uri mapper and will make some tests again.. transliteration is actually a good idea, but my opinion is that it's better to keep the url chars in the language of the site( for example is it was entered Shirt(for english name) and Red-Shirt(for english uri), it's better to have Russian words in urls, they're better understood by search engines(so the uri for russian Red-Shirt would be Красная-Рубашка , as an example). :) I'll check if it's going to work, if no then maybe I'll find a way of changing the code to keep it exactly as it was entered in uri field.
thanks for reply.
I have just installed ceon URI mapping on a new site and have found it excellent, a really nice piece of work, thanks very much.
The automatic URI generation seems to work very well but it seems to always generate /category/product-name is it possible to change something so that it generates /manufacturer/product-name instead?
I have had a search around this forum and in the configuration options for ceon but I can't find anything. I apologise if I am just being stupid and have missed the obvious answer.
Thanks again
Mark
HI,
If you look at the source code for the module you'll see that the transliteration library converts from Unicode numbers to the equivalent ascii character combinations, in a manner similar to that you've described. It just needs the input charset to be UTF-8.
Thanks for the post though! :)
All the best..
Conor
ceon
Hi,
URIs aren't allowed to have russian characters. They can only have a-z, 0-9 and a few other characters (+, /, ., -, _). That's the reason for the transliteration support in the module.
You may be able to use russian characters in your browser but you are not using a WWW browser then, the "WWW" doesn't support anything but english characters in URIs.. sad but true!
That will change in the future with internationalised URIs but WWW URIs currently only support a limited set of characters and the module is built for that.
If you want russian characters I'm afraid this software is NOT for you!
All the best...
Conor
ceon
Has anyone ever run into an issue with the Product Index pages not working properly with the Ceon URI on?
When it is turned on, I cannont add to cart any product from these pages. I can also not use the Next|2|3|4|Previous links on the page. It just refreshes the original starting page.
Thanks
Hi,
That sounds like a redirect from an "old" dynamic URI to a new static one.. breaking any "post" between one page and the next.
That could be caused by you nhot having modified the includes/functions/html_output.php with the code from URI Mapping or by you using hard-coded URIs in your template for your product index pages.. in which case you should edit the links to use any new URIs or to use the standard zen_href_link function.
Hope that helps you get this sorted.
All the best...
Conor
ceon
I have check out the includes/html_ouput.php and compared the two files. All four of the modifications are in the correct place.
The product index template has not been modified either.
Hi, Ceon, if I want to add a slash "/" at the end of the uri for any page on my site when AUTOGEN, how to?
just like below:
/about-us
/about-us/
tks!
Hello Conor,
today I just Integrating Wordpress into my Zen Cart website,
and now I want to do url rewrite for this blog, how can I do that?
it seems that there is no rewrite rule for blog
Regards,
Alan
Hi,
It doesn't do that. You'd have to modify the autogeneration function to have it add it.
The file this is in is
admin\includes\functions\extra_functions\ceon_uri_mapping.php
A simple way would be to change line 948 to
You'll have to make this change each time you upgrade the module.PHP Code:
return $uri . (substr($uri, -1) != '/' ? '/' : '');
All the best..
Conor
ceon
Hi,
If you mean that you want to exclude "/wordpress" or something from being rewritten and handled by Zen Cart then you should read the configuration documentation and FAQs that come with the module. Quick repost of the exclusion command:
# Don't rewrite cPanel directories
RewriteCond %{REQUEST_URI} !/cpanel.* [NC]
If you want to rewrite the blog URIs then you should ask someone who knows about wordpress.
All the best...
Conor
ceon
Hi,
You shouldn't use .html at the end of URIs.. you can read more about why not by searching against "URIs" and "Tim Berners Lee".
You asked to have '/' at the end of URIs for autogenerated URIs.. are you then planning on using a different format for EZ-Pages? That's a strange idea/duality.
You have to manually enter the URIs with .html on the end.
You also will then have to adjust your rewrite rule to allow rewriting of .html extensions.. you can find out more about that by reading the documentation and FAQs.
ALl the best...
Conor
ceon
For Canonical purposes, how would I echo the product URL without any zenid or sort parameters?
Hi,
Zen Cart adds those parameters. I'm afraid you'd have to modify the way Zen Cart works!
Sorry I don't have better news for you than that.
All the best...
Conor
ceon
Thanks for your reply.
Isn't the product URL that Ceon URI Mapping generates located in the database? Couldn't we just pull the URL from there?
Hi,
Sorry, I don't know what exactly you are asking. If you are asking can you read a list of URIs from the database then of course you can.. I'm afraid it's not something I can support here though.. please use software like PHPMyAdmin to do what you require!
The URIs in the database won't have session IDs or sorting parameters.
All the best...
Conor
ceon
Hi everyone,
At first i'd like to say i love this addon so bad!
And i'm definitely willing to donate.
I've got a few issue though.
I've set up some favicons, but for some reason with Ceon's URI Mapping mod the favicons disappear from category, subcategory and products pages.
How can this be fixed?
Also I can't seem to change the specials, new products, all products pages URL's (index.php?main_page=specials for example)
I'm still a noob with this addon so please bare with me :P
By the way, I have a database containing over 600 products so i was wondering when the URI manager is available.
Yours,
Peter de Leeuw
www.geurenhuis.nl
Hi Peter,
Glad you like the software!
This isn't a problem with the module but with your template.
Once you start using static URIs your favicons must be made relative to the site's root rather than the "local folder".
When in /mycategory it is likely that /mycategory/favicon.ico doesn't exist.
So you should update your link to your favicon.ico file to be /favicon.ico or set a base href on your site which sets relative file paths like this to be relative to the root of your store.
Hope that helps!
All the best..
Conor
ceon
G'day Conor, Thanks for this great mod,it looks like just what I was after and I seem to have installed it without a hitch.
Just one question....how would I go about changing it so that my items Model Name is mapped and displayed, instead of the Product Name ?Is it a Zen-Cart Admin setting? Cheers.
Hi,
I'm glad you like the software and that it installed easily for you.. unfortunately the bad news is that the module currently only autogenerates URIs for products based on their names. If you want to use model numbers you'll have to manually enter the URIs I'm afraid which isn't so bad but obviously not quite as quick/easy!).
All the best...
Conor
ceon
Thanks, I may even add both together for greater effect! You see, my products are plants and they have a "Common" name (Product Name) and a "Botanical Name"(Model Name). To have both together would be ideal as far as Search Engines go, wouldn't it? All the best.
Hi,
Yes, I do agree actually.. I think that would make it much easier to find those "products". I'd say quite a few people would search for the common name or the botanical name but not necessarily both, so having both in the URI could only help them find your store that bit easier!
All the best...
Conor
ceon
Conor
Sorry about the delay in responding. I have followed the process on again however I am getting the same problem.
However when I ran it on http://www.jbconline.eu the issue did not occur. (they are both hosted by the same hosting company)
Any ideas.
Stephen
Hi Stephen,
I'm afraid I really can't see how it's working on one site and not the other!
All I can say is what I'd do.. double check you don't have anything strange in your htaccess file, check that you have nothing strange in your virtualhost directive.
Hope that helps!
All the best...
Conor
ceon
Christian,
I know that this is quite an old post now, but wondering how your fix went for you.
I find that... http://www.example.com/index.php&main_page=index works fine but http://www.example.com/index.php&mai...dex?gclid=xxxx gives me a 404.
Did you have this problem? If so how did you get around it?
Anthony.
Never mind, I had some hard-coded links that overrode the URI mappings. I need to get less complicated!
It's me again ...
The problem I was having when I provided translated URIs for some of my Spanish pages was that I had a trailing space after the URI definition (edited via phpMyAdmin), e.g. I entered '/condiciones ' instead of '/condiciones'. Removing the trailing space made all the URI remapping happy again.:blush:
I'm just hoping this might help someone else.
Just an update and after applying the latest version of Ceon's mod everything works just fine, including going to http://www.example.com/?gclid=xxxx directly.
Thanks for the great work.
Anthony.
hello, conor.
Thanks for your wonderful URI mod. we love it so much.
after installed, it rewirte categories/products/ezpges prefectly.
however, may i ask you if this URI mod can rewrite NEWS and ARTICLES mod at http://www.zen-cart.com/index.php?ma...oducts_id=1132
thanks again:smile:
Hi,
Yes, that's right.. you'll be able to add URIs for those pages using that documentation (using PHPMyAdmin to manually add records with the query string parameters field being used to map individual articles).
I'd imagine the module you linked to could have code added so that it adds URIs to the database automatically but I'm afraid it would indeed require rewriting those modules to add the necessary PHP code.
All the best..
Conor
ceon
hello, conor,
thanks for your quick answer.
i tried to add a new record to the ceon_uri_mapping table to rewrite
/index.php?main_page=news, but unfortunately failed.
my settings are as follows:
# The URI mapping to be mapped from should be entered in the uri field. (/index.php?main_page=news)
# The number representing the language ID this URI mapping applies for should be entered in the language_id field. (en)
# The current_uri field should be set to “1” to make this the “current” URI. (1)
# The Zen Cart page to be mapped to should be entered in the main_page field. (/news)
# The date/time this URI mapping was added should be set in the date_added field (or just use the “NOW()” SQL function). (leave as it is)
# The query_string_parameters, associated_db_id and alternate_uri fields are not used, they must be left as “NULL”. The redirection_type_code is not used either so it doesn't matter what value it has (it can just be left at the default value of 301). (leave as it is)
could you plesae help to check if any mistake about above settings?
if also wan to rewrite /index.php?main_page=news_article&article_id=1 to /news/article_title, is it possible to achieve this? How?
appreciated.
Hi,
You're welcome.
I'll be honest with you, it doesn't appear you spent much time at all reading the instructions?
So you want this to be:
/news
"The Number representing"
so
1
if your language ID is 1 (if you only have one language that is likely).
Yes, that's right.
/news is a URI not a Zen Cart page but the following is the name of the a Zen Cart page:
news
I would have set it to "NOW()" as that allows the historical mapping to work properly and it only takes 2 seconds to select it from the dropdown!
I realise that examples in the docs may make these easier for people so will try to add some for the next version.
I've gone and spent this time to give an example here but I want to make anyone else who is reading this aware that I won't giving site-specific examples here frequently, I don't have the time, so please don't ask! (Sorry but life is too short to be so generous with time ;) )
Given the above and the section of the docs "Specifying the current URI Mapping for any other Zen Cart page" (part 2 of that section) you should be able to figure out what to enter.
I'll say specifically though so I don't need to reply later. please read the docs and try it yourself first then take note of the following if need be:
uri will be
/news/article_title
main_page will be
news_article
query_string_parameters will be
article_id=1
Enjoy the module and good luck with your site.
Now to get on to actual development work etc... :)
All the best...
Conor
ceon
I installed this add on and update our current products. Is anyone having trouble with SSL error messages in firefox?
Zen cart 1.3.8
Thanks
Hi,
Once you start using URI Mapping you must have the same root level for your URIs.. ie. you can't have
http://www.mysite.com/shop
and
https://sharedsssl.com/mysite.com/shop
You should purchase a SSL certificate for www.mysite.com so your SSL URIs are almost identical (i.e. end up as https://www.mysite.com)
That should get you sorted.
All the best...
Conor
ceon
Hi Conor
First off would like to say fantastic mod! and its free ....even better :D
Had abit of confusion when installing it, but persevered and it was down to my own user error (as expected!)
I do have a question tho, may have been covered off somewhere in this vast thread so appologies if it has!
Is there anyway to stop duplicates ....so if for some reason me or client added in 2 products of the same name, it would dissalow the second- maybe with an error message saying there was duplicate or something? Otherwise you wont be able to access the seperate products as they would now have the same url
I can just guarantee i would have a client that will do it haha
Neway thanks for a awesome mod!
Many regards
Scott
By how I understand how the zencart SQL database is setup. The products are created with an ID number and not a name but I learning something new everyday. I been using it for months
Hi,
You don't have to have "www" in the domain name but you must make sure that both the SSL version of the site and the non-SSL version share the same paths after the initial root directory slash.
I.e. You can't have
http://mysite.com/SHOP
and
https://mysite.com/SSLSHOP
The full path after the domain name must be identical on both the SSL and NON-SSL versions of the sites.
The best practice is to just buy the SSL certificate for the main domain name.
It is our official recommendation that the only difference between the following in your configure.php file should be the "s" after "http" in the second line:
define('HTTP_SERVER', 'http://mysite.com');
define('HTTPS_SERVER', 'https://mysite.com');
That's all you need to get things working. Enjoy the module!
All the best...
Conor
ceon
Hi Scott,
Thanks for the nice comments, it's always nice to hear the work on the software is useful to others and appreciated! :)
I did consider that when writing the software but the amount of code necessary for such a simple check just to warn someone that they've two products of the same name in the same category made me decide that it was better just to tell people not to have two products in the same category with the same name.. after all it simply isn't logical!
I know what you mean though about the potential of some "dipsy" client ( ;) ) encountering such a situation in the future but I'm afraid that is simply something we'll have to hope doesn't happen!
I may upgrade the software in future to add a check for this but it's down the list at the minute I'm afraid! :)
All the best...
Conor
ceon
Thanks for the quick reply :)
All very valid reasons not to have done it! :)
Thanks again,
Scott
Is there a way to change the home link on the site to direct to / rather than /index.php?main_page=index .... ? I am using the ceon uri remap, but I dont see a way to do this in there... has anyone done this. Google is showing duplicate home pages which I dont want. I only want google to see / not /index.php or /index.php?main_page=index
I have left the main_page field blank and tried using a / neither work. Is this possible?
Hi,
By default if your site uses
define('DIR_WS_CATALOG', '/');
in your configure.php file then your homepage should just be /
If that isn't happening for you then you should check your htaccess file and your configure.php settings. You should also check if you have any hard-coded index.php?main_page=index links on your site.
I'm afraid that's as much help as I can be as anything else is probably a problem with your server/site setup which would need someone to take a look at manually. Good luck with this.
All the best...
Conor
ceon
Hi everyone,
Just an FYI for an issue I had:
My installation is at my root level, so I used the first .htaccess code example from the documentation.
The rewrite statement at the end is:
RewriteRule (.*) index.php?%{QUERY_STRING} [L]
For my installation, I had to add the ^ symbol before the (.*) in order for it to not throw 404 (page-not-found) errors.
ie: RewriteRule ^(.*) index.php?%{QUERY_STRING} [L]
I don't know if this is just because of the particular server I'm on (hosted with Steadfast Networks) or if it's possibly a typo.
Anyhoo, that's what worked for me. Hopefully it may save someone else from pulling their hair out.
dear Ceon,Quote:
Given the above and the section of the docs "Specifying the current URI Mapping for any other Zen Cart page" (part 2 of that section) you should be able to figure out what to enter.
I'll say specifically though so I don't need to reply later. please read the docs and try it yourself first then take note of the following if need be:
uri will be
/news/article_title
main_page will be
news_article
query_string_parameters will be
article_id=1
Enjoy the module and good luck with your site.
Now to get on to actual development work etc... :)
All the best...
Conor
Great! worked perfect! genious mod.
but we have to inset table by phpMyadmin for every articles.
is it possible to set the article url through admin ares, jsut like category / ezpage .....:clap:
many appreciated for your sugestions.
This is answered in the very well written readme document that comes with this module.. In the very same place that explains how to create URIs for other site pages..
I agree with Conor's previous statement.. "I'll be honest with you, it doesn't appear you spent much time at all reading the instructions"
Hi DivaVocals,
You are right, it can rewirt the /index_page?main_page=news_article&article_id=4 by inset table into SQL. however, when pulish each areticle, have go to SQL by phpMyadmin to insert table for every artecle,
I mean is it possible to manually edit URL for each article through Admin area, same as category/product/ezpage ?:lamo:
Hi,
The news articles module is a third party module which is not part of Zen Cart as standard.
It would be perfectly possible to rewrite it to add in support for auto-generating URIs using the URI Mapping autogeneration software.
You'd have to add this functionality yourself or pay to have it added, there are no plans at Ceon to start updating other modules for free to use URI Mapping autogeneration.
All the best...
Conor
ceon
Thanks for this great mod Connor.
I installed and it works perfectly first time!
It did take a while to find out how to get my ezpage links to work but once I found out how to add them to the database with myphpadmin everything was easy!
I have a question regarding omitting certain links from URI mapping.
I've searched for hours and found nothing so I hope someone here can help.
In my store, when you're looking at the shopping cart page and you click on one of the products in your cart, you're taken to the product info page.
If the product has attributes, the attribute id is appended to the URI.
For example,
If I click on a product in the product listing, the URI I see is:
/shop/index.php?main_page=product_info&products_id=84
Whereas if I click on the same product in the shopping cart, the URI I see is:
/shop/index.php?main_page=product_info&products_id=84:4f76ce1edf582a4cbb64beef4a416bc7
The bit after the colon is the attribute id.
My question is, can I somehow stop the second link being processed by the URI mapping?
I was thinking of a rule in the .htaccess file that omits anything with a query string of
main_page=product_info&products_id=*:*
but am not sure if it is possible or if it is what the correct syntax would be?
The reason I need to do this is because my product info page needs to be able to read the products_id value from the URI to do some extra custom processing.
If there's a better way to leave this on the URI other than by .htaccess please let me know!
Thanks for your help!
Regards,
Damian
Hi,
Glad you like the software!
Why not just adjust that custom code of yours to strip everything after the colon in the product's ID?
I think you should probably start a separate thread about this, it's not really a URI Mapping issue.
All the best...
Conor
ceon
Hi Conor,
What a great script you have, it is outstanding, the guide also very comprehensive.
I just testing in one of my client's site, it works great, but this site has existing categories and products, there are about thousand of them, so since this mod doesn't mapping existing categories and products, I have to go to each category and product and click 'edit' and 'save' so that the script auto generated the URI, without clicking 'edit' and 'save' the original dynamic URL doesn't change.
I'm sure there is a way to auto-generated all existing categories/products, but I couldn't find it after browsing the support thread.
I really appreciate if you can give me a hint how to solve this problem, not really a mod problem, but a huge task for me to go to and edit each of thousand products.
Also one issue I got, after editing a product, I found additional at the end 'cPath=", how to get rid of this? I didn't yet search thread for a solution, but might want to know if this is a simple fix.
Thanks so much!
Donny
I had a couple of hours away from this and think I have come up with a fix.
If Ceon URI Mapping has broken your edit cart mod, try this. It seems to work for me :clap:
http://www.zen-cart.com/forum/showth...537#post836537
I'm not sure if it will work with any other SEO mods other than Ceon though
I am showing a lot of errors like this ( File does not exist: /home/allnativ/public_html/xxxxx) in my PhpAdmin Error Log. Just wondering if its possible I've missed something in the Rewrite Rules or Htaccess file? Of course it may not have anything to do with installing this module. Just thought I'd ask.
Using the latest version of zen cart and the CEON SEO module. The module works great...had no problem configuring it for most of my site. However, for one category it does not work. I cant figure out why it does not work. It even works for the first product in that category...but not for other products.
check this out. This works fine.
http://thecoolershade.com/store/Mens...n.Steel.Ring.I
This does not work at all.
http://thecoolershade.com/store/Mens...sed.Steel.Ring
this only happens in the Men's Rings category and everything else works great. Any help is appreciated.
Hi,
The example rewrite rules don't rewrite any URI ending in a dot and between 2 and four alphabetic characters. So the above URI isn't being rewritten.
You have to adjust your rewrite rules but please be aware that if you simply delete the following rewrite condition :
RewriteCond %{REQUEST_URI} !\.[a-zA-Z]{2,4}$
then no images will show on your site etc as their paths will also be rewritten
(.jpg, .css etc.)
You can switch from using full stops or you can add exceptions for each extension one by one by removing the above line and adding them:
RewriteCond %{REQUEST_URI} !\.jpg$
RewriteCond %{REQUEST_URI} !\.css$
etc
All the best..
Conor
ceon
Hi,
Possibly. It's impossible to tell without knowing what paths are throwing 404s!
It should be easy enough to go through your logs, see what paths are causing 404s, checking if a file is missing from that path or it the URI rewrite rule is blocking access to that path and adding an exception for that path. all the info you need for adding exceptions is in the documentation.
All the best...
Conor
ceon
Configure.php is set to use / here is a copy of my htaccess file... I don't think anything is missing. If you have a min to give it a quick glance that would be great
Code:RewriteEngine on
# redirects any URL that includes: record_company.php/password_forgotten.php
RedirectMatch Permanent ^/(.*[record_company.php]+)/(password_forgotten.php)$ /page_not_found.php
# redirects any URL that includes: /images/wp- with 'wp-' being anything that ends with '.php'
# this allows for images named such as 'wp-header.jpg' to work
RedirectMatch Permanent ^/(.*[images]+)/(wp-.*\.php)$ /page_not_found.php
# 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]
# Don't rewrite blog directory
RewriteCond %{REQUEST_URI} !^/blog.* [NC]
RewriteCond %{REQUEST_URI} ^blog.* [NC]
# Handle all other URIs using Zen Cart (index.php)
RewriteRule (.*) index.php?%{QUERY_STRING} [L]
Hi,
That all looks okay. Which means it's probably something custom on your server I'm afraid.
You should be able to manually trace this by randomly outputting the contents of the server variables (using var_dump) and seeing where the index.php?main_page is being brought in. (Could be some mod changing the environment somehow, could be your webserver, I'm not sure).
Sorry I can't be of more help than that, but that's what I'd have to do in your situation to find out why that is happening and fix this behaviour.. on our server it sticks with / all the time (as it should do).
All the best..
Conor
ceon
hello, Conor,
May i ask you another question about rewrite?
By adding table through phpMyadmin, is it possible to rewrite
link
www.example.com/category-one?&sort=20a&page=2
to
www.example.com/category-one-page-2
i tried to add table by phpMyadmin, but failed.
settings are as follows:
main page: index
query_string_parameters: cPath=3&sort=20s&page=2
thanks for your comments.:smile:
So am I right in thinking that old pages that are linked from external sites will still be handled by the module so that they resolve to correct page???
and
that canonical links will be added to the site once this is installed?
Simonbbc
Hi,
That eliminates that as a source of the problem.
YOu probably have hardlinks somewhere which reference index.php?main_page=index and google is picking up on them.
You also might simply have old google etc. links linking to index.php?main_page=index and it'll take time for them to disappear and to have only the / link represent the home page.
I'm afraid there's simply a few ways this could happen and they're all site specific, not natural behaviour caused by the module itself so I can only wish you luck in sorting this out.
It's not a massive deal though I must say, but I'm a bit of a perfectionist too and I personally can understand why a wee niggle like this would be something you'd want to get off the back of your mind! :) (Plus it may well be better to not have a duplicate link). Anyway... :)
All the best...
Conor
ceon
Hi,
If they have a "current URI" defined, then yes, the module will automatically redirect to the new URI, with the correct "permanent" redirection header. With links from search engines this should eventually result in the old URIs eventually stop being used, having been replaced with the new URIs.
That's up to how you structure things, but yes, as standard if you generate URIs for each category/subcategory/product then they'll be arranged in a hierarchy. For existing sites you'll have to update each category/product in the admin but that doesn't take long really. For new sites no work needs to be done at all for products/categories, the URIs are added as you add categories/products. You can read more in the docs, hope that helps for now.
For EZ-Pages you can enter whatever URIs you want, which allows you to struibute them into sections/subsections if desired.
BTW What's the BBC bit in the nick about?
All the best..
Conor
ceon
lol it's an old name from when you could only input three characters on the Arcade games... Stood for Bmx British Champion
but now means Simon's Best British Classics....
So if I go and install this into my www.simonbbc.com site I guess I will have a fair bit of work to do as I have a bunch of links from external sites and don't want them to be 404 when I install your module...
the only reason I am looking to move away from Sitemap XML is because I am getting duplicate headers and site crawl errors etc... in google webmaster console
Hi,
Ahh, get you. Do most machines not still only allow 3 characters or do I only ever end up playing classics the once in a blue moon I ever use an arcade machine? :)
You won't get any 404s.. the old links will still work and will remain the same. They'll only redirect to a new static URI if you have entered or generated a new static URI for the category/product/manufacturer/ez-page in question (or added one manually in the db in the case of "other" zen cart pages).
I'm afraid I still have much to learn about such things so can't comment with any degree of confidence other than to say I don't see how installing the URI Mapping module could hurt as it has the "correct" form of redirection support built in and doesn't auto-generate URIs for existing URIs unless you ask it to by "updating" URIs.. basically, after its initial installation absolutely nothing on your site will have changed.. you have to go and make changes.. one of the main points behind writing the module initially was to create a module that gave the person configuring the store full control over the URIs, whereas other modules take over the format with programmitic rewrites.
Hope that helps.
All the best..
Conor
ceon
Hi,
I happened to be looking into URI issues for some of my new software (nothing to do with Zen Cart) and it brought up the subject of canonical URIs.. you might want to have a read about them (one link is http://yoast.com/wordpress/canonical/ ).
You could update your html_header.php file to check if the current page is the home page and if so output the canonical <link> tag for the page.. that should make google see / /index.php and /index.php?main_page=index as the same page, negating the problem you were having.
Just thought I'd mention it while it was fresh in my mind!
All the best..
Conor
ceon
It's all starting to become alot clearer however... when I try to put the canonical code into my html_header.php file I can't ever find it in my templates directory, I only find tpl_header.php which I guess is the same file but can't insert the code without causing the site to display a pure white page....
This is my current code:
<?php
/**
* Atheme Template - tpl_header.php
*
* @package templateSystem
* @copyright Copyright 2007 iChoze Internet Solutions http://ichoze.com
* @copyright Portions Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_header.php 4813 2006-10-23 02:13:53Z drbyte $
*/
?>
<?php
// Display all header alerts via messageStack:
if ($messageStack->size('header') > 0) {
echo $messageStack->output('header');
}
if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
echo htmlspecialchars(urldecode($_GET['error_message']));
}
if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
echo htmlspecialchars($_GET['info_message']);
} else {
}
?>
<!--bof-header logo and navigation display-->
<?php
if (!isset($flag_disable_header) || !$flag_disable_header) {
?>
<div id="headerWrapper">
<!--bof-branding display-->
<div id="logoWrapper">
<div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
<?php if (HEADER_SALES_TEXT != '') { ?>
<div id="taglineWrapper">
<?php
if (HEADER_SALES_TEXT != '') {
?>
<div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
<?php
}
?>
<!--bof-navigation display-->
<div id="navMainWrapper">
<div id="navMain">
<ul class="back">
<?php if ($_SESSION['customer_id']) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a> |</li>
<li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>
<?php
} else {
if (STORE_STATUS == '0') {
?>
<li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a> |</li>
<li><a href="<?php echo zen_href_link(FILENAME_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_SHIPPING; ?></a></li>
<?php } } ?>
<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
<li> | <a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<?php }?>
</ul>
</div>
</div>
<!--eof-navigation display-->
</div>
<?php } // no HEADER_SALES_TEXT ?>
</div>
<br class="clearBoth" />
<!--eof-branding display-->
<!--eof-header logo and navigation display-->
</div>
<?php
if (HEADER_DROP_SWITCH == '1'){
require($template->get_template_dir('tpl_drop_menu.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_drop_menu.php');
}else{
require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php');
}?>
<div id="searchCartBarWrapper">
<div id="searchCartBar">
<div id="cartContent">
<a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo $_SESSION['cart']->count_contents() . HEADER_TITLE_CCONTENTS; ?></a>
</div>
<div id="altLinks">
<a href="<?php echo zen_href_link(FILENAME_SPECIALS, '', 'NONSSL'); ?>"><?php echo HEADER_SUB_SPECIALS;?></a> |
<a href="<?php echo zen_href_link(FILENAME_FEATURED_PRODUCTS, '', 'NONSSL'); ?>"><?php echo HEADER_SUB_FEATURED;?></a> |
<a href="<?php echo zen_href_link(FILENAME_PRODUCTS_ALL, '', 'NONSSL'); ?>"><?php echo HEADER_SUB_ALLPRODUCTS;?></a>
</div>
<?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?>
</div>
<?php
if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) {
require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php');
}?><div class="clearBoth"></div>
</div>
but here http://www.jasonjgreen.com/blog/cano...-for-zen-cart/
mentions putting this
<!– Begin SE Canonical –>
<link rel=”canonical” href= <?php
$original_url = HTTP_SERVER . $_SERVER[’REQUEST_URI’];
$split_url = explode(’?', $original_url);
$no_querystring_url = $split_url[0];
echo $no_querystring_url; ?> />
<!– End SE Canonical –>
Here
Simply copy and paste the script right after the closing title tag (</title>) of your html_header.php file (located in your Common folder of your custom template folder in your Zen Cart installation).
So I fall down at this point, am I missing the right place to drop this code or am I in the wrong file all together
Thanks for your help and I will certainly make these changes tomorrow and come back for any further help left.....
For what is a hugely important amendement to make to any site that wants to be somewhere worth while you are clearly leading the way on this topic...
Good on you
my site is www.simonbbc.com if you can see anything else wrong with some of the diag tools you would use too :P
Hi there.
I've installed the mod and think it is great.
The only "problem" I have is that I am using Zen for my webstore and my shop. To run the shop till I have Ollacart installed.
When this mod is enabled I get a 404 Error Page Not Found if I try to access the ollacart screens. Do I need to exclude this add-on and if so how? Ollacart is installed in a separate sub-directory ("/pos") on the shop's top level.
You can see the website at www.wargamesheaven.co.uk (mod turned off) and the Ollacart at www.wargamesheaven.co.uk/pos (though you wont get more than the login screen for that one).
Obviously when you read this and think "I need to know x,y and z about this site", let me know and I'll send you the info.
cheers
Guy
Hi,
Glad you like the module!
Please read the section of the docs
Adding exceptions to the rule to prevent particular addresses (e.g. Control Panels etc.) being handled by Zen Cart
It should help you fix this.
All the best..
Conor
ceon
Conor (quick reply dude)
I had added the following line to the .htaccess
# Don't rewrite POS directory
RewriteCond %{REQUEST_URI} !^/pos.* [NC]
Is that (a) correct syntax and (b) right? If it is, it doesn't stop the problem.
cheers
Guy
Hi,
If you added that before the RewriteRule bit then that opens up the /pos directory for use without any attempt to map it.
I'm afraid that if that exclusion alone doesn't work then I can't say what exact exclusions would.. it might be best to ask the makers of the other software you are using what a blanket htaccess rewrite rule (such as that used by URI mapping) needs to have excluded to let their software run.
I hope you can understand that I can't support 3rd party software here, only Zen Cart issues. I imagine you should be able to get this sorted easily enough though - good luck! :)
All the best..
Conor
ceon
Conor
First off, yup fully understand about third party stuff.
My .htaccess looks like this
<files php.ini>
Deny from all
</files>
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} !^/WHshop@11IA_Admin.* [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/editors.* [NC]
# Don't rewrite POS directory
RewriteCond %{REQUEST_URI} !^/pos.* [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]
From your message, are you saying that I have the right code but in the wrong place (i.e. it should appear earlier in the file)?
cheers
Guy
Hi,
No, that was a possibility but you have the exclusion in the right place.. which means that's not the only exclusion necessary.
All the best..
Conor
ceon
Ok, I'll get on to the Ollacart guys (if they can help I'll post here in case anyone else needs it).
cheers
Guy
You're Awesome Conor this totally worked. Just created a php file in my javascript and added the canonical and it works!
I also got the redirects to work, however if I have over the home.. it still shows the /index.php?main_page=index even though I now have it directing to /
Time for some more digging.. Love this mod. You notes on editing php my admin was invaluable. Thanks
You will want to just add it to your jscript and not to the header.php file... See this article by Dr. Byte
http://www.zen-cart.com/forum/showpo...7&postcount=18
Sound I'm getting somewhere now, thanks for all of this help..
I have installed the files etc... and set the tables up and now come to the .htaccess file
My admin folder is called "this admin" and my shop folder is "automotiveshop" but when I modify the code I get an Internal Server error.......:blush:
So is this right ?
# ONLY rewrite URIs beginning with /shop/
RewriteCond %{REQUEST_URI} ^/automotiveshop/.* [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} !^/automotiveshop/this admin.* [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/automotiveshop/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]
Hello,
Problem here. We have a category that has the same name as the manufacturer (e.g. Apple). We have the manufacturer sidebox turned on and when viewing the Apple manufacturer, instead of showing all the items from this manufacturer, it only shows the products in the Apple category. Turned off URI mapping and everything works. Any fix for this?
Thanks
I only have this one
<script type="text/javascript">
var Hoverbox = {
Version: '3.0_rc2',
options: {
backgroundColor: '<?php if(defined('HOVERBOX_BACKGROUND_COLOR')){echo HOVERBOX_BACKGROUND_COLOR;}else{echo '#ffffff';}?>',
border: <?php if(defined('HOVERBOX_BORDER_SIZE')){echo HOVERBOX_BORDER_SIZE;}else{echo '12';}?>,
buttons: { opacity: { normal: <?php if(defined('HOVERBOX_CLOSE_NORMAL')){echo HOVERBOX_CLOSE_NORMAL;}else{echo '0.65';}?>, hover: <?php if(defined('HOVERBOX_CLOSE_HOVER')){echo HOVERBOX_CLOSE_HOVER;}else{echo '1';}?> } },
cyclic: <?php if(defined('HOVERBOX_END_BEG')){echo HOVERBOX_END_BEG;}else{echo 'false';}?>,
images: '<?php echo $template->get_template_dir('',DIR_WS_TEMPLATE, $current_page_base,'images'). '/hoverbox';?>/',
imgNumberTemplate: '<?php if(defined('HOVERBOX_IMG_NUMBER')){echo HOVERBOX_IMG_NUMBER;}else{echo 'Image #{position} of #{total}';}?>',
overlay: {
background: '<?php if(defined('HOVERBOX_OVERLAY_BACKGROUND')){echo HOVERBOX_OVERLAY_BACKGROUND;}else{echo '#000000';}?>',
opacity: <?php if(defined('HOVERBOX_OVERLAY_OPACITY')){echo HOVERBOX_OVERLAY_OPACITY;}else{echo '0.85';}?>,
display: <?php if(defined('HOVERBOX_OVERLAY_ENABLE')){echo HOVERBOX_OVERLAY_ENABLE;}else{echo 'true';}?>
},
preloadHover: true,
radius: <?php if(defined('HOVERBOX_CORNER_RADIUS')){echo HOVERBOX_CORNER_RADIUS;}else{echo '5';}?>,
resizeDuration: <?php if(defined('HOVERBOX_RESIZE_DURATION')){echo HOVERBOX_RESIZE_DURATION;}else{echo '1';}?>,
slideshow: { delay: <?php if(defined('HOVERBOX_SLIDE_DELAY')){echo HOVERBOX_SLIDE_DELAY;}else{echo '5';}?>, display: <?php if(defined('HOVERBOX_SHOW_SLIDE')){echo HOVERBOX_SHOW_SLIDE;}else{echo 'true';}?> },
titleSplit: '::',
transition: function(pos) {
return ((pos/=0.5) < 1 ? 0.5 * Math.pow(pos, 4) :
-0.5 * ((pos-=2) * Math.pow(pos,3) - 2));
},
viewport: <?php if(defined('HOVERBOX_SMART_RESIZE')){echo HOVERBOX_SMART_RESIZE;}else{echo 'true';}?>,
zIndex: <?php if(defined('HOVERBOX_ZINDEX')){echo HOVERBOX_ZINDEX;}else{echo '1';}?>,
closeDimensions: {
large: { width: 85, height: 22 },
small: { width: 32, height: 22 },
innertop: { width: 22, height: 22 },
topclose: { width: 22, height: 18 }
},
defaultOptions : {
},
sideDimensions: { width: 16, height: 22 }
},
typeExtensions: {
image: 'bmp gif jpeg jpg png'
}
};
</script>
and putting it in there doesn't do anything but make my products pages blank.... any other ideas?