YUP. you nailed it.
Printable View
I've been struggling for the last couple of hours trying to solve my 404 page error after generating a URI Mapping.
I'm using hostgator and ZenCart 1.5.5a, my website is augiespanoras(dot)com I didn't have an .htcaccess file in my root directory so I created one. This is all I have in it:
Code:## BEGIN CEON URI MAPPING REWRITE RULE
RewriteEngine On
# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
# Don't rewrite any URIs for some, popular specific file format extensions,
# which are not covered by main file extension condition above
RewriteCond %{REQUEST_URI} !\.(mp3|mp4|h264)$ [NC]
# Don't rewrite any URIs for some specific file format extensions,
# which are not covered by main file extension condition above
# Uncomment the following line to apply this condition! (Remove the # at the start of the next line)
#RewriteCond %{REQUEST_URI} !\.(3gp|3g2|h261|h263|mj2|mjp2|mp4v|mpg4|m1v|m2v|m4u|f4v|m4v|3dml)$ [NC]
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/admin_augie [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/editors/ [NC]
# Don't rewrite logs directory
RewriteCond %{REQUEST_URI} !^/logs/ [NC]
# Don't rewrite magicthumb directory
RewriteCond %{REQUEST_URI} !^/magicthumb/ [NC]
# Don't rewrite zc_install_x directory
RewriteCond %{REQUEST_URI} !^/zc_install_x/ [NC]
# Handle all other URIs using Zen Cart (its index.php)
RewriteRule .* index.php [QSA,L]
## END CEON URI MAPPING REWRITE RULE
Well ... don't change the name of the zc_install directory, delete it immediately. It should not be on the server under any name at all.
As for changing the name of the admin folder again, yes that is a good idea, but security by obscurity is not security at all.
There should be no way in even if the admin folder name is public. Changing it just reduces the volume of hacking attempts.
I have been trying to install this addon on a clean Zencart install 1.5.5a... for some reason, when I am done, I can't log in to the store side of the site. I can still access admin without any problems. On the store side, I can view everything, add items to my cart but when I try to log in, it won't let me. I removed the addon completely and I could log in again. I figured I might have missed a step and redid everything again... nope still not working and I am not getting an error log on this and the logs folder is writeable. Any thoughts?
I've since found that if I remove the file includes/init_includes/overrides/init_sessions.php, I can once again log in to the store side. However, I get this error when I do the installation check
which is obviously normal... I am still trying to figure it out but this is the third time I've installed this addon on fresh stores and never had this happen. Any input would be greatly appreciatedQuote:
A file must have a modification made to it, to work with Ceon URI Mapping, but the file does not exist at all!
The path to the file is /home/myembro/public_html/test/includes/init_includes/overrides/init_sessions.php
•Add the missing file and make sure you apply the modifications required for Ceon URI Mapping.
This is the bit of code that the addon requires but also makes it so that I can no longer log in...
It is the exact same code that I have on my previous site and it worked fine there but not on this site. The only difference between the 2 sites is that the older one is running on Zencart 1.5.1Code:// BEGIN CEON URI MAPPING 1 of 1
// Static URIs are relative to the site's root, so cookie should be set for the root
$path = '/';
// END CEON URI MAPPING 1 of 1
Sorry don't mean to post this much but trying to supply as much information as possible. Thanks
I also found the same issue when updating the URI mapping files for ZC155 and php7, but only on my local server and not 100% of the time.
I didn't get to the bottom of it, got sidelined by other things.
It's not implemented on a real server yet to be able to take it further.
ok so I have a temporary fix...
original code
temporary fixCode:// BEGIN CEON URI MAPPING 1 of 1
// Static URIs are relative to the site's root, so cookie should be set for the root
$path = '/';
// END CEON URI MAPPING 1 of 1
I can now log in on all browsers, however if I run the Installation check, I get an error but the mapping seems to be working as it should. I just don't know what other problems might arise from this change. Any input would be greatly appreciatedCode:// BEGIN CEON URI MAPPING 1 of 1
// Static URIs are relative to the site's root, so cookie should be set for the root
$path = '';
// END CEON URI MAPPING 1 of 1
Hi All,
Have just had the latest version of Ceon URI Mapping 4.5.1 installed on zencart version 1.5.4 and have an issue with dashboard not showing the all the tabs as shown below:
Attachment 16559
Note that it is missing the other tabs which are in image below:
Attachment 16560
Can someone tell me how this can be corrected as I want to be able to use the feature that updates all the URI on the site. At present I have to go into each item in order to generate the URI mapping and as I have over 24,000 products this would take some time to do.
Any help would be appreciated.
Ok as a potentially new user of this "plugin", I see Conner started this and apparently passed away. At one point, jsweb took over, and then gave up on it. I saw a post about ceon.net, but, that site is offline (at least right now). And, I see someone named jeking has provided the latest updates.
So, if someone who has been around a while can answer:
1. What is the relationship (if any) between jeking and Ceon?
2. Is there really a ceon.net that is still developing this module?
3. Since jeking seems to have released a number if updates, what process if any is in place to report bugs and fixes so the next version incorporates those?
Anyone know if it is required to load the admin portions of this module? i.e., if I maintain the data outside of admin (have a feed that updates the urls, etc.), is it really necessary for any of the admin portions? Would be great if not really needed. Less to deal with on any updates.
I have one product, only one product that when we try to add it to the cart, the product is not adding to the cart. If I turn off Ceon URI Mapping, no problem it can be added to the cart but as soon as I turn it back on, the problem is there again. None of the other products that the URI mapping has been done on does this... only the one.
Anyone had that happening to them? I've searched this thread and what I am finding so far isn't helping.
this is the link:
.../shop/designs/bookmarks/3d-alphabet-amazement
yes sorry, I've since then deleted the product entirely and recreated it in another category and now the mapping is working. weirdest thing
Who helps me php I upgraded to version 7 but I can not run Ceon uri mapping with version 7. I have a php error includes / classes / class.String.php on line 57, quamdo edit or create a product I click on the view changes I get blank page errorre 500 what should I change?
I have fixed all the PHP7 errors with CEON URI Mapping, running it locally on Xampp.
Hosting does not have PHP7 switching enabled yet so have not tried in a production shop.
I will set up a Github soon so others can try out my changes.
OK Steve, do you expect that the changes even if you give me the Github link to follow the discussion.
ok problem solved, place the solution can serve to someone else, the problem was in the DB table the three items of the DB were INNODB I changed them to MYISAM and now works with the 7.0.8 version of php.:D
sorry I was too volece to say that it works, it really is as before if I create a Ceon category does not work, the category is still created when I click on confirm I get a blank page but then I see that the category is created.
Another fairly serious problem, on the home page when they are activated special index, new products, etc future products if you have products with buy now button and click there you get url with a question mark at the end (?)
Pon I can not believe Dark! it is also true about the products in the categories I had not noticed !!
Now what do you do? possible that I have not noticed it before, someone has a solution why the plugins is to dowload does more harm than good as well.
debugging reports in includes / classes / class.String.php on line 57 for the issue of php version 7. For how much regards the addition of any thing in the url is a serious problem because ottento DUPLICAT content with search engines . I always thank Ceon for its plugins unfortunately left us rest in peace my friend.
Hi, Conor!
I installed the modul on Zen Cart 1.5.0
And I have a problems:
When try to execute: Moduls/ Ceon URI mapping ( SEO ) config, the page stop working - I cannot to execute the command.
The front store is inaccessible.
Whan should I do to fix this problems?
Thanks
Hi and Thanks!
This is from log file:
[05-Sep-2016 21:07:11 Europe/Sofia] PHP Fatal error: require_once(): Failed opening required 'includes/classes/class.CeonURIMappingConfigUtility.php' (include_path='.:/usr/local/php5.3/lib/php') in /home/perfects/public_html/zc_admin/ceon_uri_mapping_config.php on line 26
I am using v1.5.0 because it's familiar to me and its seems too difficult to upgrade :)
Looks like missing or having a problem accessing at least one file from the upload: admin/includes/classes/class.CeonURIMappingConfigUtility.php
Suggest verifying that all files were uploaded in their entirety, and that the access permissions are 644 or as directed by your host.
And now that it appears that you have posted your admin directory path, you should change it, which in your case on ZC 1.5.0, requires modification of the admin/includes/configure.php file paths and references to the admin directory (in ZC 1.5.1 and above the admin directory is auto-detected) and will also eventually need to modify the .htaccess file that is recommended by this plugin because it specifically suggests the admin directory and it's contents be excluded from uri rewriting.
One of the problem was the capital letters in classes names. Cerrected. But still have no access to the front store. Can you send me clean .htaccess file?
Hello Perfecto the .htaccess files you have to create you as admin zencart modules Ceon uri
That's correct, it does not add or modify the .htaccess file. Doing so could be catastrophic to a website. In fact, because yours does not yet have the proper content, you should disable this plugin so that customers can continue navigating your site until it is properly setup and installed.
As to obtaining the content that to be added to your .htaccess file, as diamond1 was trying to identify. Please goto your modules menu, then Ceon URI Mapping (SEO) Config, then the installation check tab, then the installation check section, there is a link to click. After clicking that link, if the installation thus far is correct/successful, then towards the bottom should be a list of rewrite rules to incorporate into your .htaccess if you have one, or in the case of a fresh ZC install into a newly created file.
When incorporating into an existing file, care should be taken to be sure that sequencing is correct and that other things are not impacted. Once normal operation is verified, then enable this plugin and check that normal operation still works, then start adding your rewritten uris.
If doing this on a test server/setup (as recommended for all new installations of anything), then it is most helpful to be using a sub-domain that has the same sub-directory(ies) as your live site.
I have used the fileset in the plugins 4.5.2 and merged my changes for PHP7.
Available now on Github for testing: https://github.com/torvista/CEON-URI-Mapping
Steve !!! You are a wizard Thank you owe an granita coffee. I confirm works with that Zen cart 1.5.4 1.5.5a
Bugfix
When all site is SSL using these settings on config.php:
define('HTTP_SERVER', 'https://YOURSITE...
and
define('ENABLE_SSL', 'false'); yes, that DOES says false as per
https://www.zen-cart.com/showthread....91#post1311391
customer is unable to log in with Chrome (but Firefox yes). An issue with cookie setting/handling.
Merged changes in html_output.php ZC155 to make the relevant section identical (including formatting, for future comparisons).
Available in Github.
https://github.com/torvista/CEON-URI-Mapping
"Our URI Mappings Manager software has the ability to auto-generate URI mappings for all/selected Categories/Products/Manufacturers/EZ-Pages/Other Zen Cart Pages at once."
Without this auto-generate mapping script this plugin is useless for me and it was a waist of time to install the uri mapping seo plugin.
Although there is some chat about an auto-generate script what have to be implanted in an admin file ??
maybe somebody will explain how to get this autoscript to work
I use this mod and it does automatically create the URI link. When you upload all the files and do all that it tells you to do in the read me, you go to admin/configuration and look down the list for the mod, set it to 1 to turn it on.
Then go to admin/modules and make sure you set things in there too. It will give you a "script" to then add to the top of your .htaccess file in the main directory of your server....public_html or what ever yours is called.
The only thing to remember is if you should change the name later on of the product then check the little box at the bottom of the product page before hitting the preview button or it will not change it.
Multilanguage Stores using the hreflang tag.
Zen Cart 1.55a
in templates/YOUR_TEMPLATE/common/html_header.php
we have
In a vanilla ZC site there is always a parameter in the canonical url so the ADDITIONAL language parameter can be separated with a "&":Code:<?php
// BOF hreflang for multilingual sites
if (!isset($lng) || (isset($lng) && !is_object($lng))) {
$lng = new language;
}
reset($lng->catalog_languages);
while (list($key, $value) = each($lng->catalog_languages)) {
if ($value['id'] == $_SESSION['languages_id']) continue;
echo '<link rel="alternate" href="' . ($this_is_home_page ? zen_href_link(FILENAME_DEFAULT, 'language=' . $key, $request_type) : $canonicalLink . '&language=' . $key) . '" hreflang="' . $key . '" />' . "\n";
}
// EOF hreflang for multilingual sites
?>
www.site.com/link?parameter&language=es
With CEON URI Mapping there is no parameter so the language tag should be separated with a "?" or you get 404 not found errors being reported in Webmaster Tools.
I made this change. Note this includes the bug change as reported here:
https://www.zen-cart.com/showthread....42#post1319742
Code:<?php // BOF hreflang for multilingual sites
if (!isset($lng) || (isset($lng) && !is_object($lng))) {
$lng = new language;
}
//steve bof CEON uri mapping
//CEON uri mapping produces a canonical link with no extra parameters: so no "?" after the url.
//To create the alternate urls for hreflang use, for all pages (apart from the home page), '&language=' is appended to the canonical url. This gets a page not found (in the Google Search Console) as the "&" needs to be a "?" as there are no other parameters.
//Since the $canonicalLink is already created, it needs to be checked for the presence of a "?". If so, ok, if not use the "?" instead of "&".
$url_parts = parse_url($canonicalLink);
$separator = ( isset($url_parts['query']) ? "&" : "?" );
//eof
reset($lng->catalog_languages);
while (list($key, $value) = each($lng->catalog_languages)) {
//if ($value['id'] == $_SESSION['languages_id']) continue;//steve a self-link is also required https://www.zen-cart.com/showthread.php?214746-Implementing-hreflang-in-a-multilanguage-store&p=1319742#post1319742
//echo '<link rel="alternate" href="' . ($this_is_home_page ? zen_href_link(FILENAME_DEFAULT, 'language=' . $key, $request_type) : $canonicalLink . '&language=' . $key) . '" hreflang="' . $key . '" />' . "\n";
echo '<link rel="alternate" href="' . ($this_is_home_page ? zen_href_link(FILENAME_DEFAULT, 'language=' . $key, $request_type) : $canonicalLink . $separator . 'language=' . $key) . '" hreflang="' . $key . '" />' . "\n";//steve changed separator
}
// EOF hreflang for multilingual sites
//steve eof CEON uri mapping
?>
Hi, I am really confused about getting my genres setup for uri mapping. Everything else went smoothly but I have no idea how to configure my zen cart to map the genres. I did a search in your forum for "genre" and there is nothing. I tried copying your sample tpl_music_genres_select to my template directory with no luck and now I'm out of things to try. Any advice is appreciated.
Hi picandnix, I've setup all of my inventory and categories with no problems but the genres do not have this option. Go into a category, save it, and CEON shows that the re-write has been completed but you can't do this with genres. I'm trying to figure out if there's a way I can do a rewrite with something like this:
http://cheapsongbooks.com/index.php?...sic_genre_id=2
This is how the genre is currently shown for my jazz songbooks... I'd like to change it to something like: http://cheapsongbooks.com/jazz
I have 10 genres and am willing to change them manually if necessary.. only program is I'm not a programmer.
Thx
Hi Guys,
Can anyone help?
I have a problem when both CEON URI and Sitemap XML are enabled:
Sitemap XML returns "page not found" when I clik "Force rebuild all sitemap*.xml files! and Pinging Search Engine".
When I disable CEON URI, and do the task again it works, the confirmation page for rebuilding xml files and search engines ping shows up.
XML files seem to updated but no confirmation page is shown after, only page not found when CEON is ON.
This is how the link appears when the page not found shows up: (http://www.mydomain/sitemap-xml&rebuild=yes&ping=yes&)
Zen Cart V1.5.1,
Sitemap v3.6 26.04.2016 10:33:09
CEON URI - 4.5.1
Thank you!
I'm still hoping some one can help me with an answer on URI mapping for genres. I've posted this question once with no results. I've setup all of my inventory and categories with no problems but the genres do not have this option. Go into a category, save it, and CEON shows that the re-write has been completed but you can't do this with genres. As of today, my website is showing this designation for the jazz genre.
http://cheapsongbooks.com/index.php?...sic_genre_id=2
I'd like to change it to something like: http://cheapsongbooks.com..genre=jazz or something that might help get rankings using genre & jazz in the link. Is this possible ?
I have 10 genres and am willing to change them manually if necessary.. I'm not a programmer but I'm willing to give it shot.... thx
I just had a quick look at your site and would like to suggest that after choosing an instrument, a genre selection would maintain that instrument selection. I'm pretty sure there's a module that does this kind of thing, and might at the same time solve your genre SEO question.
So for your example from earlier:
http://cheapsongbooks.com/index.php?...sic_genre_id=2
In the tools->install sql patches, apply the following:
Where the first '1' represents the language number for the language to which this is applied (typically English but this needs to be reviewed/verified by looking at your localities/languages section).Code:INSERT INTO `ceon_uri_mappings`
(`uri` ,`language_id` ,`current_uri` ,`main_page` ,`query_string_parameters` ,`associated_db_id` ,`alternate_uri` ,`date_added`)
VALUES
( '/jazz','1','1','index','typefilter=music_genre&music_genre_id=2',NULL ,NULL , NOW() );
Ok thanks but what about the second 1 ? I just want to make sure it doesn't refer to type... all of my inventory is type 2. Thx
Did the vertical alignment of the information not make sense?
notice how `uri` has '/jazz' below it?
`language_id` and '1'...
Pretty much all of this is covered in the documentation explaining what piece of information should go into which field and the potential concerns of using anything more than a single parameter in the query_string_parameters field.
Ok, that's a little embarrassing but I get it now. Thanks. On another subject: after you helped me figure out my easypopulate issue, I started looking around to see how I could convert my uri's without having to edit each one separately. I found a post showing the module you have created and looks like the perfect solution. I'll plan to get it this weekend.... I was going to private post you on this but I thought it might be a good idea to let other zc users know it's available.
Hi Torvista
Currently having the same issue Chrome not liking the cookies and won't let us login - I have looked at the github but the htnl_output.php file is exactly the same as I already am using - could you highlight what you changed to resolve this issue - or is it still a bug? ie not resolved?
Thank you
Sarah
If the login issue with chrome is related to the admin side, then please see: https://www.zen-cart.com/showthread....43#post1320243
It affects all ZC versions 1.5.0 and above but was corrected in 1.5.5.b.
I assume you mean you cannot login in the CATALOG side? Any problem on the ADMIN side is unrelated, and is indeed probably as per the previous post.Quote:
Currently having the same issue Chrome not liking the cookies and won't let us login
The version I have on Github is the same as my live site which is working ok.
If the problem persists you can post your (obfuscated) site address here for review.
It appears I have found a bug in the current fileset, relating to the creating of urls from the admin side.
I find that very hard to believe but since Conor is not here to enlighten me, I'll describe in detail so someone else can corroborate it.
Catalog Side
On a page, links to other pages are created using the Catalog function zen_href_link
This builds the link in two chunks:
a) The server bit that is the same per site, eg: www.mysite.com/myshop/
I'll call this the link stub to simplify things.
b) The page bit: index.php?main_page=product_info&cPath=2_1273&products_id=819
The CEON URI code is inserted between a) and b) and when enabled, makes a nice friendly url like this:
manufacturers/rg-racing/general-accessories/rg-dhb0001bk-deluxe-helmet-bag
And it returns the two bits concatenated to make the link:
www.mysite.com/myshop/manufacturers/rg-racing/general-accessories/rg-dhb0001bk-deluxe-helmet-bag
All well and good.
Admin Side
URI mapping is used on the admin side to generate friendly urls such as emails sent to customers such as Back in Stock notifications, or Abandoned Shopping Cart reminders, Order Status updates, Sitemapxml.
In this case the Admin function zen_catalog_href_link is used.
In the CEON fileset, I find two things that stop this from building the link correctly.
1) the CEON code is inserted BEFORE the a) above, so only the page link is returned from the function:
manufacturers/rg-racing/general-accessories/rg-dhb0001bk-deluxe-helmet-bag
2) The CEON method/function call is this:
buildHREFLink(NULL, $page, $parameters, $connection, false))
The first parameter is the link stub that has to be prefixed to the friendly url.
As it is set to null it still will not work. It should be "$link".
Once these two changes are made, the email links are generated correctly.
So, for those who want to test, the complete Admin function zen_catalog_href_link as I currently have it is
But then again, I might be missing something...!!PHP Code:
function zen_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL') {
global $zco_notifier;
$link = null;
$zco_notifier->notify('NOTIFY_SEFU_INTERCEPT_ADMCATHREF', array(), $link, $page, $parameters, $connection);
if($link !== null) return $link;
if ($connection == 'NONSSL') {
$link = HTTP_CATALOG_SERVER . DIR_WS_CATALOG;
} elseif ($connection == 'SSL') {
if (ENABLE_SSL_CATALOG == 'true') {
$link = HTTPS_CATALOG_SERVER . DIR_WS_HTTPS_CATALOG;
} else {
$link = HTTP_CATALOG_SERVER . DIR_WS_CATALOG;
}
} else {
die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL<br><br>Function used:<br><br>zen_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>');
}
// BEGIN CEON URI MAPPING 1 of 1 - placed AFTER the web server address is built as per the catalog side but NOT as per the file in the CEON URI installation pack!! This issue is highlighted by BISN that uses this function.
if (defined('CEON_URI_MAPPING_ENABLED') && CEON_URI_MAPPING_ENABLED == 1) {
if (!isset($ceon_uri_mapping_href_link_builder)) {
static $ceon_uri_mapping_href_link_builder;
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'class.CeonURIMappingHREFLinkBuilder.php');
$ceon_uri_mapping_href_link_builder = new CeonURIMappingHREFLinkBuilder();
}
if ($ceon_uri_mapping_href_link_builder->buildHREFLink($link, $page, $parameters, $connection, false)) {//steve changed first parameter from null to link or it loses the base server address
return $ceon_uri_mapping_href_link_builder->getHREFLink();
}
}
// END CEON URI MAPPING 1 of 1
if ($parameters == '') {
$link .= 'index.php?main_page='. $page;
} else {
$link .= 'index.php?main_page='. $page . "&" . zen_output_string($parameters);
}
while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);
return $link;
}
...continuing my monologue...the above code is not correct.
I decided to get into 2016 and used the available notifier instead
https://www.zen-cart.com/showthread....alog_href_linkQuote:
$zco_notifier->notify('NOTIFY_SEFU_INTERCEPT_ADMCATHREF', array(), $link, $page, $parameters, $connection);
So now no modifications are necessary to html_output (catalog/admin).
These changes have been added to my Github.
Hi, I am hoping some one would be able to help me.
I'm not aware of any changes to my site, but all of a sudden I was getting 404 errors on all of my product pages.
I ran the Ceon URI Mapping Installation check it came back with an error:
The file it is talking about is includes/functions/general.php, but all it says it make the modifications and doesn't tell me what is wrong or what the modifications are.Quote:
A file requires 2 modifications to be made for it but none of the modifications have been made.
Does anyone have any idea?
Thanks!
Download the original mod zip file and go through the readme/install instructions.
Has your PHP version been updated perhaps?
Hi Thanks, for your help.
I did this and updated the general.php file, ran the installation check again and it came back saying everything was now fine.
I then thought I would test what happens if I create a new page.
If I create a new category page then it adds this to my navigation, the URI mapping creates a URI for the page, but going to it on the website provides a 404.
I tried to do the same with an EZ-page and it creates the page, with some content on it, but if I try to enable a header or footer or specify an URI for that page it doesn't save the changes.
Does this sound like a wider issue?
I don't think my PHP has been updated, I checked and I am running version 5.3.29
Thanks
What content is in your htaccess file? (obscure the reference to your admin directory) and be sure to include all of the content of the htaccess file not just what needs to be added to support this plugin.
Hi Thanks,
Code:AddHandler php-stable .php
## BEGIN CEON URI MAPPING REWRITE RULE
RewriteEngine On
# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
# Don't rewrite any URIs for some, popular specific file format extensions,
# which are not covered by main file extension condition above
RewriteCond %{REQUEST_URI} !\.(mp3|mp4|h264)$ [NC]
# Don't rewrite any URIs for some specific file format extensions,
# which are not covered by main file extension condition above
# Uncomment the following line to apply this condition! (Remove the # at the start of the next line)
#RewriteCond %{REQUEST_URI} !\.(3gp|3g2|h261|h263|mj2|mjp2|mp4v|mpg4|m1v|m2v|m4u|f4v|m4v|3dml)$ [NC]
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/XXX [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/editors/ [NC]
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/admin/ [NC]
# Handle all other URIs using Zen Cart (its index.php)
RewriteRule .* index.php [QSA,L]
## END CEON URI MAPPING REWRITE RULE
Hi, I'm still not getting anywhere with this.
I have noticed that the Ceon site is down for maintenance, I'd like to think it wouldn't have any impact on the functionality, but can I just rule this out?
Any other help would be greatly appreciated too.
Thanks
It has no impact on functionality of this plugin as provided on this forum and was only provided to potentially identify an updated version being available through a sort of one way pull, get the current information data from the site, analyze locally what needs to be done if anything and take appropriate action.
As to your issues, it's concerning that it had been "installed", but that one file had not been edited or if it had it may have been replaced without the necessary edits. While the install test is supposed to identify if all of the files have been edited properly, that doesn't necessarily mean that there isn't something extra done... Or something else that has gotten modified away from the default/standard install.
Is the site in a web-facing sub-directory of any kind? (ie. htt p : / / my site . com / zencart)
This is what I use as the RewriteRule portion of the htaccess modifications that works on the site its needed:
I have omitted all of the RewriteCond lines from the above as in principle they are the same as what is provided previously.Code:RewriteRule ^(.*)$ /index.php [QSA,L]
When I added the following code to the .htaccess file in my zencart directory, it worked for me.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /zencart directory/index.php [QSA,L]
That is one possible solution/method to apply, though it is a bit more server intensive because the attempted file(s) in the path need to be tested against the contents of the server to see if the file/directory does or does not exist. Although there shouldn't really be a space as part of the resolving url (ie. In /zencart directory/ this should be a complete word or phrase like /zencart_directory/ instead).
Regarding the generation of the canonical url.
ZC vanilla: <link rel="canonical" href="https://DOMAIN/SUBDIR/">
CEON URI: <link rel="canonical" href="https://DOMAIN/SUBDIR">
So what!
Well, while reinventing code for structured data/og tags for facebook, I found that re-using this url in the og:url tag was failing in the CEON case (resulting in facebook not finding anything on the home page, using the opengraph debugger) due that missing trailing slash.
Looking in class.CEONUriMappingHandlerBase.php I find:
While this does remove the trailing slash, I don't see any exclusion for the shop root/home page.Quote:
// Remove any trailing slash(es) from the canonical URI, unless the URI is the root of the site
while (strlen($ceon_uri_mapping_canonical_uri) > 1 &&
substr($ceon_uri_mapping_canonical_uri, -1) == '/') {
$ceon_uri_mapping_canonical_uri =
substr($ceon_uri_mapping_canonical_uri, 0, strlen($ceon_uri_mapping_canonical_uri) - 1);
}
For the moment I have changed it to this:
and it has cured this particular issue.Quote:
// Remove any trailing slash(es) from the canonical URI, unless the URI is the root of the site
while ($this_is_home_page && strlen($ceon_uri_mapping_canonical_uri) > 1 &&
substr($ceon_uri_mapping_canonical_uri, -1) == '/') {
$ceon_uri_mapping_canonical_uri =
substr($ceon_uri_mapping_canonical_uri, 0, strlen($ceon_uri_mapping_canonical_uri) - 1);
}
I can see this being another one of my monologs...
So shouldn't the note above that code also be modified? Only remove trailing slashes on the home page? Currently as provided it only removes the trailing slash when on the home page and not on any other page whereas before it described that the trailing slash would be removed from all pages but the homepage, though it didn't specifically remove/account for the page being the homepage...
How does the change affect linked product if any by leaving the trailing slash followed by the '?' and master category?
I have the News Box Manager installed on our site. Is there a way of integrating it with "Ceon URI Mapping" so that we can have for example:instead ofCode:https://www.welsh-lovespoons.co.uk/news/lovespoons-booklet
Thanks for any advice.Code:https://www.welsh-lovespoons.co.uk/index.php?main_page=more_news&news_id=2
This type of action is covered in the documentation (at least it was way back in version 4.4.1) See section 10 of the configuration area. ie: _docs/sections/configuration.html#uri-other-zen-cart-pages
More than likely you will want to apply the second method because of the news_id parameter. If unable to find that information in the docs or unable to understand how to apply it, then please come back with more information about what has been attempted and what is not understood.
Very good module
I installed Ceon URI Mapping v4.x But my site is in Bulgarian and ignore the Cyrillic alphabet in generating url ....
I have a 9000 product there any option to generate automatically ie whole catalog ..
Version"1.5.5a
The problem with Cyrillic resolved, but I can not generate the entire catalog automatically ...
The module will not do this, there was a commercial (paid for) module from Ceon that would generate for existing URL's. I believe that someone who posted a couple of posts above has a module/tool that combines Ceon with Easy Populate if you're not able to purchase the original Ceon module.
Hello, I have just fresh installed 155e and after few bugfixes already mentioned in the forum I found one more in CEON URI mappings module so I am sharing it here.
When I try to update/generate category or products mappings blank page apears. On the same server I have another 155d version with the exact same CEON module working.
My php Server is 7.1 and if I turn it back to 5.6 the URI mappings on my 155e seems to generate normaly.
And also this erro apears in the log
Does anybody have the same problem?Code:[08-Mar-2017 19:56:19 Europe/Sofia] PHP Fatal error: Cannot use 'String' as class name as it is reserved in /home/xxxxxx/xxxxxxxxxxxx/includes/classes/class.String.php on line 57
Yes when using the version currently available for download from this site, but no when proper renaming is performed as implemented by torvista at his github location. String has become a reserved name and therefore can not be used as it is.
Here is a link for sollution if needed!
https://github.com/torvista/CEON-URI-Mapping
Kind regards and many thanks to mc12345678!
Note that the "string" name issue is one of several problems that crop up with php7.
The version in the Plugins section is now very much out of date.
My version has all these fixes already done and documented in the updated readme.
Yes the code works fine, but putting the package up for public consumption means I should revise the documentation and the installation self-check routines to maintain the idiot-proofness.Quote:
Steve would now be a good time to update the version in the plugins section?
I'll try and do it soon...
Hi, thank you very much. I have followed the doumentation and I've managed to do this in Cpanel. The only issue I have is when switching languages:
For example https://www.welsh-lovespoons.co.uk/news/stdavid , but when I click on the 'CYMRAEG' link to visit the Welsh language page the URL is https://www.llwyaucaru.com/newyddion...=5&language=cy instead of just https://www.llwyaucaru.com/newyddion/dewisant
Also if the ID is changed it takes you to a different story for example - https://www.llwyaucaru.com/newyddion...=4&language=cy
Is there a way to change this so that ?main_page=more_news&news_id=* never appears in the URL (similar to what happens with EZPages)? Let me know if this isn't clear. Thank you so much for any advice.
The entry that was made to provide /news/stdavid (or perhaps just /stdavid) was a single datapoint. For each different arrangement to be used, a different datapoint must be applied. As pointed out ezpages permit such an action of storing the uri that is generated, but you may notice that for each language there is a field in which to fill in or permit auto-generation of the URI. So, if you have two languages for the "same" news_id, then there will need to be two uris provided/two database entries. Now, I don't exactly get/understand how/why one is redirected away from the current domain name and further what would be involved to ensure that the receiving domain name is able to be in sync, but whatever is used to accomplish that must also take into account what is being entered from this site to get to the other site.
As to "if the ID is changed" I am not sure what you mean. Do you mean if one types in a different news_id, or do you mean that if the article is moved from one news_id to another. If the article is moved, I would say that is not a good process, regarding trying to use a different news_id to see different news, well that's back to the above about assignment of one datarow for each unique condition/object.
So as to the language_id that should be used, that can be found in the admin->localization->languages area associated with each language that is installed.
I was able to use either 1.5.5d or 1.5.5e with the software from the referenced link, though the important part of the difference between what is currently available from here and the github location is php 7.x. The version at github has so far been compatible with it.
Hi folks
I'm having a problem with CEON uri mapping. Can somebody pls help.
I have just moved servers. My zen cart is 1.5.1 and is installed on zencartsite.com running PHP 5.3.29 (website names are fictitious - like that's not obvious, duh)
On old webhost I had othersite.com as main domain and zencartsite.com as an addon domain. (all was ok here)
On new webhost I have zencartsite.com as Main domain and othersitesite.com as addon domain.
Ceon uri mapping is working properly on zencartsite.com as main domain and I've installed lets encrypt ssl too. All works fine.
The problem is that the addon domain othersite.com is somehow being redirected to a subfolder of the main domain, so i'm getting:
https://www.zencartsite.com/othersite.com
At first I was getting a 500 error. Then I added the following line to .htaccess in public_html
and I am able to see the index.html of othersite.com but the url in the browser says: https://www.zencartsite.com/othersite.comCode:# Don't rewrite addon domains
RewriteCond %{REQUEST_URI} !^/othersite.com/ [NC]
When I disabled .htaccess in public_html I was able to get othersite.com/index.html so the problem must be with CEON uri mapping (as it's the only thing in .htaccess besides the redirection to https)
Why is the addon domain being redirected to a subfolder of the main domain?
Is there any sweet soul who can help? Any suggestions?
thanks
Millie :wacko:
Hi folks
I'm having a problem with CEON uri mapping. Can somebody pls help.
I have just moved servers. My zen cart is 1.5.1 and is installed on zencartsite.com running PHP 5.3.29 (website names are fictitious - like that's not obvious, duh)
On old webhost I had othersite.com as main domain and zencartsite.com as an addon domain. (all was ok here)
On new webhost I have zencartsite.com as Main domain and othersite.com as Addon domain.
Ceon uri mapping is working properly on zencartsite.com as main domain and I've installed lets encrypt ssl too. All works fine.
The problem is that the addon domain othersite.com is somehow being redirected to a subfolder of the main domain, so i'm getting:
https://www.zencartsite.com/othersite.com
At first I was getting a 500 error. Then I added the following line to .htaccess in public_html
and I am able to see the index.html of othersite.com but the url in the browser says: https://www.zencartsite.com/othersite.comCode:# Don't rewrite addon domains
RewriteCond %{REQUEST_URI} !^/othersite.com/ [NC]
When I disabled .htaccess in public_html I was able to get othersite.com/index.html so the problem must be with CEON uri mapping (as it's the only thing in .htaccess besides the redirection to https)
Why is the addon domain being redirected to a subfolder of the main domain?
Is there any sweet soul who can help? Any suggestions?
thanks
Millie
Need more information:
Would be good to have the old and new htaccess files (obscure admin directory if included): also previously was this plugin used for both domains or just othersite?
When moving over, how was the determination of what to include in the htaccess determined?
With regards to file structure, where is othersite in comparison to zencartsite? Both before and now.
Also regarding folder structure where are both sites as relates to public_html?
With regards to the statement that the issue is this plugin, it really comes down to server setup (how the outside gets to othersite) and what is contained in the htaccess(es) that guide the visitor(s) to the applicable destination(s).
Hi mc12345678
Thank you so much for answering. I’ll answer your questions:
a) I’m attaching 3 htaccess files. I’ve obscured names.Quote:
Would be good to have the old and new htaccess files (obscure admin directory if included): also previously was this plugin used for both domains or just othersite?
1. Old webhost public_html .htaccess (please note that zencartsite.com was first the main domain, then it was changed to addon domain here – it still is an addon domain now)
........Code:<Files 403.shtml>
order allow,deny
allow from all
</Files>
deny from 173.8.
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://zencartsite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://zencartsite.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://zenner.zencartsite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://zenner.zencartsite.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.zenner.zencartsite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.zenner.zencartsite.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://zencartsite.othersite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://zencartsite.othersite.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://ecl.othersite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://ecl.othersite.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://english-lessons-online.othersite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://english-lessons-online.othersite.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://othersite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://othersite.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://othersite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://othersite.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.zencartsite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.zencartsite.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.zencartsite.othersite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.zencartsite.othersite.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.ecl.othersite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.ecl.othersite.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.othersite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.othersite.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.othersite.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.othersite.com/.*$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp|flv|swf)$ - [F,NC]
RewriteCond %{HTTP_HOST} ^othersite.com$
RewriteRule ^news$ "http\:\/\/www\.thirdwebsite\.com\/news\/" [R=301,L]
2. Old webhost zencartsite.com .htaccess (zencartsite is addon domain)
Code:suPHP_ConfigPath /home/myusername/public_html/zencartsite.com
<Files 403.shtml>
order allow,deny
allow from all
</Files>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.zencartsite.com/$1 [R=301,L]
RewriteRule ^zencart.*$ https://www.zencartsite.com/ [R=301,L]
AddHandler application/x-httpd-php5 .php
## BEGIN CEON URI MAPPING REWRITE RULE
# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !^/zencart/ [NC]
# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
# Don't rewrite any URIs for some, popular specific file format extensions,
# which are not covered by main file extension condition above
RewriteCond %{REQUEST_URI} !\.(mp3|mp4|h264)$ [NC]
# Don't rewrite any URIs for some specific file format extensions,
# which are not covered by main file extension condition above
# Uncomment the following line to apply this condition! (Remove the # at the start of the next line)
RewriteCond %{REQUEST_URI} !\.(shtml|3gp|3g2|h261|h263|mj2|mjp2|mp4v|mpg4|m1v|m2v|m4u|f4v|m4v|3dml)$ [NC]
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/myadmin [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/editors/ [NC]
# Don't rewrite zodiacimages directory
RewriteCond %{REQUEST_URI} !^/myimages/ [NC]
# Don't rewrite cgi-bin directory
RewriteCond %{REQUEST_URI} !^/cgi-bin/ [NC]
# Don't rewrite elementstrial directory
RewriteCond %{REQUEST_URI} !^/elementstrial/ [NC]
# Don't rewrite logs directory
RewriteCond %{REQUEST_URI} !^/logs/ [NC]
# Handle all other URIs using Zen Cart (its index.php)
RewriteRule .* ./index.php [QSA,L]
## END CEON URI MAPPING REWRITE RULE
RewriteCond %{HTTP_HOST} ^zencartsite.com[nc]
RewriteRule ^(.*)$ https://www.zencartsite.com/$1 [L,R=301,nc]
Redirect 301 /contact.shtml https://www.zencartsite.com/index.php?main_page=contact_us
DirectoryIndex index.php index.html
#COMMENT | This denys other sites from IFraming your site. It prevents clickjacking.
# Header always append X-Frame-Options SAMEORIGIN
The plugin was used only in zencartsite.com It was installed at the old webhost first in zenner.zencartsite.com for testing, then when ready I moved it to zencartsite.com (an addon domain)
.......
3. New webhost zencartsite.com (here it is the Main Domain)
Code:#suPHP_ConfigPath /home/myusername/public_html/zencartsite.com
<Files 403.shtml>
order allow,deny
allow from all
</Files>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.zencartsite.com/$1 [R=301,L]
#Options +FollowSymLinks
#RewriteEngine On
#RewriteCond %{SERVER_PORT} 80
#RewriteRule ^(.*)$ https://www.zencartsite.com/$1 [R=301,L]
#RewriteCond %{REQUEST_URI} portal
#RewriteRule ^(.*)$ https://www.zencartsite.com/portal/$1 [R=301,L]
RewriteRule ^zencart.*$ https://www.zencartsite.com/ [R=301,L]
## BEGIN CEON URI MAPPING REWRITE RULE
# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !^/zencart/ [NC]
# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
# Don't rewrite any URIs for some, popular specific file format extensions,
# which are not covered by main file extension condition above
RewriteCond %{REQUEST_URI} !\.(mp3|mp4|h264)$ [NC]
# Don't rewrite any URIs for some specific file format extensions,
# which are not covered by main file extension condition above
# Uncomment the following line to apply this condition! (Remove the # at the start of the next line)
RewriteCond %{REQUEST_URI} !\.(shtml|3gp|3g2|h261|h263|mj2|mjp2|mp4v|mpg4|m1v|m2v|m4u|f4v|m4v|3dml)$ [NC]
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/myadmin [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/editors/ [NC]
# Don't rewrite myimages directory
RewriteCond %{REQUEST_URI} !^/myimages/ [NC]
# Don't rewrite cgi-bin directory
RewriteCond %{REQUEST_URI} !^/cgi-bin/ [NC]
# Don't rewrite elementstrial directory
RewriteCond %{REQUEST_URI} !^/elementstrial/ [NC]
# Don't rewrite logs directory
RewriteCond %{REQUEST_URI} !^/logs/ [NC]
# Don't rewrite addon domains
RewriteCond %{REQUEST_URI} !^/othersite.com/ [NC]
# Handle all other URIs using Zen Cart (its index.php)
RewriteRule .* ./index.php [QSA,L]
## END CEON URI MAPPING REWRITE RULE
#RewriteCond %{HTTP_HOST} ^zencartsite.com[nc]
#RewriteRule ^(.*)$ https://www.zencartsite.com/$1 [L,R=301,nc]
Redirect 301 /contact.shtml https://www.zencartsite.com/index.php?main_page=contact_us
DirectoryIndex index.php index.html
#COMMENT | This denys other sites from IFraming your site. It prevents clickjacking.
# Header always append X-Frame-Options SAMEORIGIN
AddHandler application/x-httpd-php53 .php .php5 .php4 .php3
b) Migration was done by the new webhost (cpanel to cpanel). They just copied everything including the .htaccess from the old webhost zencartsite.com addon domain. Then there was a problem with the configure.php in admin/includes and I couldn’t access admin but they fixed it. I can now access admin zone and also have ssl certificate installed.Quote:
When moving over, how was the determination of what to include in the htaccess determined?
c) At old webhost when ceon uri mapping was installed it was:Quote:
With regards to file structure, where is othersite in comparison to zencartsite? Both before and now.
Public_html (which includes all the files of othersite.com – there is no zen cart in othersite.com – No 1 .htaccess)
|
Zenner folder (subdomain of zencartsite.com - Ceon was first installed here)
|
Zencartsite.com folder (addon domain) – originally zencart without ceon was installed in subfolder i.e. zencartsite.com/zencart – after testing CEON in zenner, I transferred all files straight to zencartsite.com i.e. the cart was the domain, no subfolder anymore - No 2 .htaccess)
At new webhost:Quote:
Also regarding folder structure where are both sites as relates to public_html?
Public_html (zencartsite.com is here with No 3.htaccess)
|
Othersite.com folder
In new webhost Othersite.com has its own .htaccess but all there is in it is:
Options +FollowSymlinks
Options +Indexes
DirectoryIndex index.html
d) I’ve pasted all the htaccess files I have. When in No 3 .htaccess in public_html I disabled first the ssl redirection only, I got no ssl on zencartsite.com and www.zencartsite.com/othersite.com Then I disabled the cEON part and I was able to get othersite.com/index.html. I asked two of the ‘gurus’ in the webhost support team and they both said that the problem must be coming from the public_html .htaccessQuote:
With regards to the statement that the issue is this plugin, it really comes down to server setup (how the outside gets to othersite) and what is contained in the htaccess(es) that guide the visitor(s) to the applicable destination(s).
I hope you can help mc12345678. You’re my last resort at this point!
Thank you so much for trying
Millie :)
hi mc12345678
Further to the post above, I need to make it clear that only zencartsite.com has and has ever had a zen cart installed. Othersite.com is a very small old site with about 10 pages of .shtml and 3 pages of .php with contact forms. Othersite.com never had a zen cart. This is why it is so strange that the ceon uri mapping is somehow affecting othersite.com
Any indication of what I should be looking out for would be most welcome.
Thank you.
Millie
Okay, you've got my head spinning... :)
One thing that sticks out is in your new .htaccess (current one) there is this line:
What this appears to do is take what may have been your "old" address and convert it to the new zencartsite...Code:RewriteRule ^zencart.*$ https://www.zencartsite.com/ [R=301,L]
Put it another way, you've got a lot that is/was going on...
If I understand your directories and usage correctly, you previously had zencartsite loaded into a subdirectory, that subdirectory was
referenced by your host using a domain name: so
Old:
othersite -> public_html/ <- .htaccess 1
zencartsite -> public_html/zencart/zencart . com <- .htaccess 2
New:
othersite -> public_html/othersite . com <- .htaccess 4 (little info, but there is one)
zencartsite -> public_html/ <- .htaccess 3
zencartsite is the only site that is ZC, and othersite has nothing to do with it, correct?
I could really go into all of the issues that the current .htaccess appears to present; however, if I have a correct understanding of the
site structure (based on my crude "diagram" above), then this is the basic structure I suggest assuming the .htaccess files in place.
New .htaccess 3:
It seems that this is all that really is needed based on the content that was identified for the new site with zencartsite as the root.Code:#suPHP_ConfigPath /home/myusername/public_html/zencartsite.com
<Files 403.shtml>
order allow,deny
allow from all
</Files>
AddHandler application/x-httpd-php53 .php .php5 .php4 .php3
Redirect 301 /contact.shtml https://www.zencartsite.com/index.php?main_page=contact_us
DirectoryIndex index.php index.html
## BEGIN CEON URI MAPPING REWRITE RULE
# Do rewriting ONLY for zencartsite.com
RewriteCond %{HTTP_HOST} ^(www\.)?zencartsite\.com\.?(:80)?$ [NC]
# Don't rewrite any URIs that point to the old zencart folder
RewriteCond %{REQUEST_URI} !^/zencart/ [NC] #<---- When properly used, the zencart folder could have/should have been rewritten using the plugin and not this rewritecond/rewriterule
# Don't rewrite addon domains
RewriteCond %{REQUEST_URI} !^/othersite.com/ [NC]
# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
# Don't rewrite any URIs for some, popular specific file format extensions,
# which are not covered by main file extension condition above
RewriteCond %{REQUEST_URI} !\.(mp3|mp4|h264)$ [NC]
# Don't rewrite any URIs for some specific file format extensions,
# which are not covered by main file extension condition above
# Uncomment the following line to apply this condition! (Remove the # at the start of the next line)
RewriteCond %{REQUEST_URI} !\.(shtml|3gp|3g2|h261|h263|mj2|mjp2|mp4v|mpg4|m1v|m2v|m4u|f4v|m4v|3dml)$ [NC]
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/myadmin [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/editors/ [NC]
# Don't rewrite myimages directory
RewriteCond %{REQUEST_URI} !^/myimages/ [NC]
# Don't rewrite cgi-bin directory
RewriteCond %{REQUEST_URI} !^/cgi-bin/ [NC]
# Don't rewrite elementstrial directory
RewriteCond %{REQUEST_URI} !^/elementstrial/ [NC]
# Don't rewrite logs directory
RewriteCond %{REQUEST_URI} !^/logs/ [NC]
# Handle all other URIs using Zen Cart (its index.php)
RewriteRule .* ./index.php [QSA,L]
## END CEON URI MAPPING REWRITE RULE
Now folder discussion? That's a bit of another topic, but... There are two folder structures that could be of concern.
One, is the "internal" folder structure /home/user/public_html/site1/site2/site3
The other is what visitors see: web facing folder...
Based on how things are "working".. Currently othersite is in a subfolder of zencartsite, but it can also be reached directly by
othersite . com. What happens after that is all on how the software works at othersite . com
Now I didn't add in/offer any of the other "suggestions" that previously existed or were commented out, because 1) they were commented out
and 2) they may not have been transferred (old .htaccess 1 included some protections of not copying images... May want to have those
added in/back or something similar that doesn't require so much effort to maintain)...
Anyways, the above will provide rewriting for zencartsite and be disabled for othersite. If you need othersite to also use the rewriter
because it too has gone zen, then would need to do some other things to make it work, but I believe the above will put you back in biz.
hi mc12345678
So sorry about the tardiness in replying. This whole thing really did my head in.
The way cpanel works is that the addon domain (othersite.com) is a subdomain of the main domain i.e. othersite.zencartsite.com I tried with all your suggestions and I just couldn't get it to work properly. I couldn't get othersite.com not to show up as a subdirectory. I kept getting https://www.zencartsite.com/othersite.com Cpanel is quite confusing that way as even subdomains are listed under public_html as separate folders. Then they're redirected and addon domains are supposed to be domains in their own right. I wonder if this is really true. I wonder what the effect on SEO really is. Everyone keeps telling me that this method has no eddect on SEO but I'm not too sure. This is the reason why I wanted the zencartsite.com to be the main domain. The webhost then tried to put othersite.com above public_html to avoid the .htaccess in public_html having any effect on it but this broke everything and both sites went down.
In the end, as time was running out, I decided to delete everything and change the cpanel to the way it was with the old webhost. i.e. made othersite.com as main domain and zencartsite.com as an addon domain. That seemed to fix the problem and now both sites are up.
Thank you so much for trying to help mc12345678. I guess my diagram of what is under public_html was not clear enough and that confused issues. If you have any thoughts about the above I would appreciate reading them. I hope this whole messup and your insight might help somebody else in this situation.
Thanks again
and Happy Easter/Passover/Eid or simply Spring (or Autumn) as the case may be.
Best regards
Millie
So, there is a way to make it work with the desired setup, but it requires understanding the setup of the system before getting to the .htaccess file... As identified by the cPanel documentation on addon domains, creation of an addon domain will create a subdomain. But understand also, that the presence of the sub-folder does not make it a subdomain... a subdomain is the domain with a prefix.
Now that said, the .htaccess of the parent directory can have an effect on the child directory, and therefore the .htaccess that is in the parent directory should be written to only affect that directory for the rule(s) that are to only affect that particular area, otherwise they can also cause modifications to the sub-directory. If you plan to continue to try to modify the setup/arrangement, I found this helpful information to make it a little easier to have a go at eventually generating the desired/necessary .htaccess.
Ideally, if you are able to assign directories (documentRoot) to each the main/other domain, then the following would likely suit best:
public_html/othersite . com / othersitefiles such as index.html
public_html/zensite . com / catalogfiles such as index.php
.htaccess in zensite . com would have the rewrite rules for CEON URI mapping and the one in othersite . com would have its own "small set" of rules. Then basically no .htaccess in the public_html folder or something that is to apply to both sites.
All that said, I have the following recommendation for your setup if you choose to go the route of your zencartsite as your main site and this othersite (having a different domain name) as an addon domain:
.htaccess in public_html:
Code:#suPHP_ConfigPath /home/myusername/public_html/zencartsite.com
<Files 403.shtml>
order allow,deny
allow from all
</Files>
AddHandler application/x-httpd-php53 .php .php5 .php4 .php3
Redirect 301 /contact.shtml https://www.zencartsite.com/index.php?main_page=contact_us
DirectoryIndex index.php index.html
RewriteEngine On
# Handle cases where the subdomain is used: othersite.com.zencartsite.com (Might need to just be othersite.zencartsite.com but check your cPanel or with host for what the subdomain is for assignment related to this situation.
RewriteCond %{HTTP_HOST} ^(www\.)?othersite\.com\.zencartsite\.com$ [NC]
RewriteRule ^([a-z.]*)$ http://othersite.com/$1 [R=302,L] #Change to a 301 when all appears functional from a "clean" browser (cookies/cache cleared)
# Handle zencartsite.com/othersite.com to redirect to just othersite.com and maintain anything else that was originally on the uri to include
RewriteCond %{HTTP_HOST} ^(www\.)?zencartsite\.com$ [NC]
RewriteCond %{REQUEST_URI} ^/(www\.)?othersite\.com [NC]
RewriteRule ^(www\.othersite\.com|othersite\.com)?([a-z./]*)$ http://othersite.com/$2 [R=302,L] #Change to a 301 when all appears functional from a "clean" browser (cookies/cache cleared)
# Force zencartsite to https
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.zencartsite.com/$1 [R=302,L] #Change to a 301 when all appears functional from a "clean" browser (cookies/cache cleared)
### And finally, if have made it through all of the things above, can actually process the rules to be able to use the associated redirect(s).
## BEGIN CEON URI MAPPING REWRITE RULE
# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{HTTP_HOST} ^(www\.)?zencartsite\.com\.?(:80)?$ [NC,OR]
RewriteCond %{HTTP_HOST} ^(www\.)?zencartsite\.com\.?(:443)?$ [NC]
# Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])
RewriteCond %{REQUEST_URI} !\.[a-z]{2,5}$ [NC]
# Don't rewrite any URIs for some, popular specific file format extensions,
# which are not covered by main file extension condition above
RewriteCond %{REQUEST_URI} !\.(mp3|mp4|h264)$ [NC]
# Don't rewrite any URIs for some specific file format extensions,
# which are not covered by main file extension condition above
# Uncomment the following line to apply this condition! (Remove the # at the start of the next line)
RewriteCond %{REQUEST_URI} !\.(shtml|3gp|3g2|h261|h263|mj2|mjp2|mp4v|mpg4|m1v|m2v|m4u|f4v|m4v|3dml)$ [NC]
# Don't rewrite admin directory
RewriteCond %{REQUEST_URI} !^/myadmin [NC]
# Don't rewrite editors directory
RewriteCond %{REQUEST_URI} !^/editors/ [NC]
# Don't rewrite myimages directory
RewriteCond %{REQUEST_URI} !^/myimages/ [NC]
# Don't rewrite cgi-bin directory
RewriteCond %{REQUEST_URI} !^/cgi-bin/ [NC]
# Don't rewrite elementstrial directory
RewriteCond %{REQUEST_URI} !^/elementstrial/ [NC]
# Don't rewrite logs directory
RewriteCond %{REQUEST_URI} !^/logs/ [NC]
# Don't rewrite addon domains
# RewriteCond %{REQUEST_URI} !^/othersite\.com [NC]
# Handle all other URIs using Zen Cart (its index.php)
RewriteRule (.*) index.php [QSA,L]
## END CEON URI MAPPING REWRITE RULE
Then, in your othersite directory the following .htaccess:
There are potentially other "beneficial" items to have in your .htaccess; however, I wanted to provide the "functionality" that you had with what seems to be the functionality expected, desired, or needed.Code:Options +FollowSymlinks
Options +Indexes
DirectoryIndex index.html
RewriteEngine On
RewriteCond %{HTTP_HOST} !^othersite\.com$ [NC]
RewriteRule ^(.*)$ http://othersite.com/$1 [R=302,L] #Change to a 301 when all appears functional from a "clean" browser (cookies/cache cleared)