Hi Conor!
My appology because it was a very simple and somehow stupid mistake of my side! My error was that for htaccess page I did not had included the . in front of the htaccess! That's why it wasn't reconizing it!
I solved that problem already once I realized what happened.
BTW, I'm moving from oscommerce to zen-cart!
However, now I have a few other pages that are not being rewritten or at least that's what I believe... I have checked the installation doc files and while these talk about these pages, I guess I'm not figuring it out... If there is a thread that mention this already, please point me to it because I've been reading and reading and I cannot find it.
PAGES NOT BEING REWRITTEN:
1. all pages that go inside of the information box that in my case includes: about us, shipping, returns, privacy, conditions, contact, sitemap, unsubscribe, discounts and coupons, newsletter, gift certificates. All of these, I have them inside of the information box and not part of the EZ-Pages.
This is an example of how about_us shows: index.php?main_page=about_us. Please tell me if that's the right way to show instead of: domain.com/about_us?
2. Other pages that show like about us example include: New products: index.php?main_page=products_new (not sure if that's the way that's the way it should look here) and featured products: index.php?main_page=featured_products
3. I installed the addon Wordpress on Zencart (WOZ). Now, this addon on the admin configuration side stays the following:
NOTE:
please edit the following file.
/includes/init_includes/init_ceon_uri_mapping.php
Add the new lines shown, around approx line 115:
----------------------------------------------------------------------------
$uri_to_match = preg_replace('/[^a-zA-Z0-9_\-\.\/%]/', '', $request_uri);
// for WordPress On ZenCart BOF
$woz_uri_query = "
SELECT
um.language_id,
um.uri
FROM
" . TABLE_CEON_URI_MAPPINGS . " um
WHERE
um.main_page = '" . FILENAME_WORDPRESS . "'
ORDER BY
BIT_LENGTH(um.uri) DESC;";
$woz_uri_result = $db->Execute($woz_uri_query);
$woz_uri = '';
while (!$woz_uri_result->EOF) {
$woz_uri = $woz_uri_result->fields['uri'];
if(ereg("^$woz_uri", $uri_to_match)){
if(ereg("/comments/feed/", $uri_to_match)){
$_GET['feed'] = 'comments-rss2';
}else if(ereg("/feed/", $uri_to_match)){
$_GET['feed'] = 'rss2';
}
$uri_to_match = $woz_uri;
break;
}
$woz_uri_result->MoveNext();
}
// for WordPress On ZenCart EOF
if (substr($uri_to_match, -1) == '/') {
I followed the instructions and I get a black page. I guess I'm placing it on the wrong part of the page? I tried in different sides, but still get a black page with it. Please tell me, where in here should I place it?
==========================================
if (!isset($_SESSION['language']) || isset($_GET['language'])) {
$lng = new language();
if (isset($_GET['language']) && zen_not_null($_GET['language'])) {
$lng->set_language($_GET['language']);
$language_changed = true;
unset($_GET['language']);
} else {
if (LANGUAGE_DEFAULT_SELECTOR == 'Browser') {
$lng->get_browser_language();
} else {
$lng->set_language(DEFAULT_LANGUAGE);
}
}
$_SESSION['language'] = (zen_not_null($lng->language['directory']) ?
$lng->language['directory'] : 'english');
$_SESSION['languages_id'] = (zen_not_null($lng->language['id']) ?
$lng->language['id'] : 1);
$_SESSION['languages_code'] = (zen_not_null($lng->language['code']) ?
$lng->language['code'] : 'en');
}
if ($language_changed && $original_language_id == $_SESSION['languages_id']) {
$language_changed = false;
}
if (is_null($original_language_id)) {
$original_language_id = $_SESSION['languages_id'];
}
======================================
ADDITIONAL QUESTIONS:
4. I have written the 404 rule in the htaccess as: ErrorDocument 404 index.php?main_page=page_not_found . It works, just want to ensure that's the proper way to write it.
DEALING WITH THE DUPLICATE CONTENT:
Google sees mydomain.com, www.mydomain.com and event mydomain.com/ and www.mydomain.com/ each as different pages as per what experts say.
Will the below rule be enough and still compatible with the CEON URI MAPPING addon?
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.domain\.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
</IfModule>
My last question and also related to url rewrite. I found this info online:
Next, lets say you are changing to Zen Cart from some *other shopping cart platform and wish to retain your link juice, PageRank and such by redirecting the old urls to the new.
We can do this easily by sending all requests to the root, but it’s far more effective to use some logical redirecting to the proper area in the *new cart. For this a query string redirect is perfect.
RewriteEngine On
RewriteCond %{QUERY_STRING} category=76
RewriteRule (.*) http://www.domain.com/index.php?main_page=index&cPath=220$1? [R=301,L]
In this case, we identified a string (category=76) in all urls of our old site’s category and are redirecting them by matching the string to our new category. Remember to use your proper canonical.
How do we apply this rewrite rule once we have applied the CEON URI MAPPING (SEO) addon?
Conor, I will appreciate that you take a look at them and give me a brief answer.
Highly appreciated,
Loyd
Hi,
I just installed URI Mapping (SEO) but on the Configuration page it says to Go to Modules > URI Mapping (SEO) Config in the Zen Cart admin. But I don't see URI Mapping (SEO) Config in the modules section.
Raptors hi!
Ensure you have installed all files from the folder files, modified_core_files and template_override_files... read once again the installation instructions on docs.
----------------------
ANOTHER QUESTION FOR CONOR:
Conor, this is once again related to the .htaccess file.
I have products that have the same name and sometimes the same description, except that have different color and different style number. Is there a possibility to make the rewrite something like this: category-name/product-name-p-2 (where p stands for product and 2 stands for the product number based on category) or something similar to this string and simple?
Once again, very very appreciated!
Loyd
Hi,
That of course makes sense. Glad you've got it sorted now.
Yes, these URIs are not mapped automatically. You can map them yourself by entering mappings directly into the database.
Please read the section in the documentation "Specifying the current URI Mapping for any other Zen Cart page" and follow the first part of that.
E.g. your uri is /about_us and the main_page is about_us and the rest of the values are as outlined in the instructions.
These URIs can be mapped using the same procedure as above.
Sorry, the custom modifications distributed with that addon are not supported by Ceon.
Eventually I intend to look at that contribution with a view to fixing it but unfortunately I don't have the time at the minute. I'd suggest not using it but using another Wordpress module instead. DivaVocals on the forum has another one I think, which works.
I'm not a rewrite expert but that looks alright to me.
Sorry, I don't know if it will be enough. It certainly won't conflict with the URI Mapping rule though.
You'll have to ask someone who knows more about rewrite rules about this. Unfortunately that's not appropriate for this thread, so please search the forum or start another one.
Sorry, again, this thread is not the place to ask for advice on custom rewrite rules, please search the forum/start a new thread.
The software does allow you to enter "historical URIs" to be mapped to "current URIs", by manually adding records to the database with current_uri set to 0 instead of 1.. it should be easy enough to work out what other parameters you need to set to have the "old" URI map to the correct Zen Cart page.
Hope all the above helps!
All the best...
Conor
ceon
Hi,
Yes, that's right Raptors, please do as Loyd says, restart the installation from the beginning.. you've missed something.
Sorry, one proviso of current versions of the module is that, to use autogeneration, you MUST rename any products which are in the same category which have the same name, so that they have UNIQUE names. You'll break the products otherwise and no-one will be able to buy anything but the first of the products which have the same name in a category.
If there's a difference between each product, such as colour or style number, make this part of the product's name.. it will make the URI more meaningful as well as avoid the problem of several products trying to use the same URI.
The only other option is to go as far as the "preview" stage of updating a product, then to copy the test of the autogenerated URI preview, press "back" and paste the URI into the text box. You'd then manually add your differentiating text to the URI (e.g. adding "2" after one, then "3" after the next etc.).
All the best..
Conor
ceon
Hello Conor,
Thank you for your answers! I appreciate it.
YOU REPLIED
Yes, these URIs are not mapped automatically. You can map them yourself by entering mappings directly into the database.
Please read the section in the documentation "Specifying the current URI Mapping for any other Zen Cart page" and follow the first part of that.
E.g. your uri is /about_us and the main_page is about_us and the rest of the values are as outlined in the instructions.
MY REPLY: While I noticed it does talk about it, since it doesn't give an actual example, it appears to be harder for me to implement. But I will give it a try and see if I can make these pages from the phpmyadmin tool. I know how to run sql commands on the tool, just that since I do not have an example of the command to run, makes it a little bit harder. Just an example could have made it easier.
-----------------
YOU REPLIED:
Sorry, the custom modifications distributed with that addon are not supported by Ceon.
Eventually I intend to look at that contribution with a view to fixing it but unfortunately I don't have the time at the minute. I'd suggest not using it but using another Wordpress module instead. DivaVocals on the forum has another one I think, which works.
MY REPLY:
This addon actual does support Ceon, but the issue is that when you follow the instructions in adding the code given by WOZ for /includes/init_includes/init_ceon_uri_mapping.php you get a blank page. Since it is your page the one being customized and not one from the addon, I thought you were the right person to ask the question to. Anywhere I add it, it appears to get a blank page after it. So, I guess I'm adding it on the wrong spot.
As for the 404 rule, it's working for me ;) I ask you the question because I thought you might be good on htaccess rules.
YOU REPLIED:
Sorry, again, this thread is not the place to ask for advice on custom rewrite rules, please search the forum/start a new thread.
The software does allow you to enter "historical URIs" to be mapped to "current URIs", by manually adding records to the database with current_uri set to 0 instead of 1.. it should be easy enough to work out what other parameters you need to set to have the "old" URI map to the correct Zen Cart page.
MY REPLY:
Can you give me an example code (not how to do it, but a code example) to query on the database for "historical URIs"?
I will also post a new thread. I know there is a way to do it using htaccess, but I don't know the right way of the rule rewritte
Thanks
Loyd
Once again, thank you for answering my questions Conor!
YOU REPLIED:
Sorry, one proviso of current versions of the module is that, to use autogeneration, you MUST rename any products which are in the same category which have the same name, so that they have UNIQUE names. You'll break the products otherwise and no-one will be able to buy anything but the first of the products which have the same name in a category.
If there's a difference between each product, such as colour or style number, make this part of the product's name.. it will make the URI more meaningful as well as avoid the problem of several products trying to use the same URI.
The only other option is to go as far as the "preview" stage of updating a product, then to copy the test of the autogenerated URI preview, press "back" and paste the URI into the text box. You'd then manually add your differentiating text to the URI (e.g. adding "2" after one, then "3" after the next etc.).
MY REPLY:
I guess I will have to manually add the model number so that it makes it a different page.
If I'm not mistaken, I believe browsing this forum I noticed someone who is using Ceon URI Mapping does have a way to this where it adds an id to the end of the title. Just can't find her to ask her how she achieved it. If I cannot find her, I will go with the model number at the end of each auto-generated title.
Thanks once again for answering these questions,
Loyd
Hi Loyd,
No problem. I hope you don't mind that some I simply can't give a detailed response to as I have very limited time.
You don't create SQL commands. You use the "Insert" functionality of PHPMyAdmin and simply fill in the form for a row.. using that, the information I've given you should make easy indeed, just put in the values I gave an example off, along with the "standard values" the documentation talks about (date_added set to NOW() etc.).
Certainly it wouldn't have helped with a SQL command, that's far more complex! :)
I'm afraid I've no idea.
No problem.. as I said, it looks alright to me, but yes, I'm not an expert in this field! ;)
Same as above, you don't use code, but the "Insert" functionality of PHPMyAdmin.
Hope that helps!
All the best..
Conor
ceon
Thanks once again Conor!
I was able to figure out that if I were to query the db the code to use is:
INSERT INTO `zen_ceon_uri_mappings` (`uri`, `language_id`, `current_uri`, `main_page`, `query_string_parameters`, `associated_db_id`, `alternate_uri`,`redirection_type_code`, `date_added`) VALUES
follow by the values to insert...
QUESTION1 (most important):
Using the Insert or the query command, do I still need to associate the uri I'm entering with 'associated_db_id' for contact_us, about_us, shippinginfo and so forth? If not, I leave the value as empty? If I do need to enter an associated_db_id for them, how do I find the right one because if I do a search for value on contact_us, I get a few values...
QUESTION2 (very imporant):
For the about_us, contact_us, shippinginfo, and so on pages, for 'main_page' value, do we need to enter: index for value or for example: CONTACT-US main_page value would be:contact_us and so forth as anyone could see just pointing the cursor to the link and seeing the browser footer link it gives where index.php?main_page=value?
QUESTION2:
What is 'alternate_uri' for?
QUESTION3:
When using the Insert tool, do I need to enter the Null Values or just leave it blank and it automatically fill it with NULL value? I'm not familiar with the insert tool. I always used a query command...
Sorry for keep asking questions about it. I just want to use your addon and I need to have these solved so it could work for me. I'm pretty sure that this thread will help others having similar problem until a new version help handdling the current and historic URI from admin.
Thank you once again Conor!
Loyd
Bookmarks