Zen Cart Logo
Forums / All Other Contributions/Addons / Ceon URI Mapping v4.x

Ceon URI Mapping v4.x

Views: 451,977

Results 2,101 to 2,120 of 2,454
28 Mar 2017, 4:45 PM
#2101
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Ceon URI Mapping v4.x

ehswift:

Were you able to get this to work properly with Zen Cart v1.5.5d or v1.5.5e? If so, which one were you able to get it work with?

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.

11 Apr 2017, 3:50 PM
#2102
millie63 avatar

millie63

New Zenner

Join Date:
Apr 2014
Location:
London
Posts:
22
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

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

# Don't rewrite addon domains
RewriteCond %{REQUEST_URI} !^/othersite.com/ [NC]

and I am able to see the index.html of othersite.com but the url in the browser says: https://www.zencartsite.com/othersite.com

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:

11 Apr 2017, 3:58 PM
#2103
millie63 avatar

millie63

New Zenner

Join Date:
Apr 2014
Location:
London
Posts:
22
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

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

# Don't rewrite addon domains
RewriteCond %{REQUEST_URI} !^/othersite.com/ [NC]

and I am able to see the index.html of othersite.com but the url in the browser says: https://www.zencartsite.com/othersite.com

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

11 Apr 2017, 4:14 PM
#2104
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

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).

11 Apr 2017, 6:02 PM
#2105
millie63 avatar

millie63

New Zenner

Join Date:
Apr 2014
Location:
London
Posts:
22
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

Hi mc12345678

Thank you so much for answering. I’ll answer your questions:

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?

a) I’m attaching 3 htaccess files. I’ve obscured names.

  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)
<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]

........

  1. Old webhost zencartsite.com .htaccess (zencartsite is addon domain)
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)

.......

  1. New webhost zencartsite.com (here it is the Main Domain)
#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

When moving over, how was the determination of what to include in the htaccess determined?
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.

With regards to file structure, where is othersite in comparison to zencartsite? Both before and now.

c) At old webhost when ceon uri mapping was installed it was:

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)

Also regarding folder structure where are both sites as relates to public_html?

At new webhost:

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

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).
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 https://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 .htaccess

I hope you can help mc12345678. You’re my last resort at this point!

Thank you so much for trying

Millie :)

11 Apr 2017, 8:02 PM
#2106
millie63 avatar

millie63

New Zenner

Join Date:
Apr 2014
Location:
London
Posts:
22
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

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

11 Apr 2017, 8:04 PM
#2107
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

Okay, you've got my head spinning... :)

One thing that sticks out is in your new .htaccess (current one) there is this line:

RewriteRule ^zencart.*$ https://www.zencartsite.com/ [R=301,L]

What this appears to do is take what may have been your "old" address and convert it to the new zencartsite...

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:

#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   

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.

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.

14 Apr 2017, 9:57 AM
#2108
millie63 avatar

millie63

New Zenner

Join Date:
Apr 2014
Location:
London
Posts:
22
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

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

14 Apr 2017, 7:47 PM
#2109
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

Millie63:

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:

#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:

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) 

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.

5 Jun 2017, 8:49 PM
#2110
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

I followed the instructions to do the following:

  • For example, to create a static URI for “index.php?main_page=specials”:
    uri: /latest-offers
    main_page: specials
    by updating the table ceon_uri_mappings, now when i type the URLwww.mysite.com/latest-offers
    it takes me to the special page but the URL in the browser change to
    https://www.mysite.com/index.php?main_page=specials

Did i forget something?

5 Jun 2017, 11:44 PM
#2111
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

TamyA:

I followed the instructions to do the following:

  • For example, to create a static URI for “index.php?main_page=specials”:
    uri: /latest-offers
    main_page: specials
    by updating the table ceon_uri_mappings, now when i type the URLwww.mysite.com/latest-offers
    it takes me to the special page but the URL in the browser change to
    www.mysite.com/index.php?main_page=specials

Did i forget something?

Which instructions?

What specific SQL was used to add the record to the database?

Are uris of other product that are generated working fine or are they too responding by taking the visitor to the desired page but with the base ZC uri?

6 Jun 2017, 12:07 AM
#2112
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

mc12345678:

Which instructions?

What specific SQL was used to add the record to the database?

Are uris of other product that are generated working fine or are they too responding by taking the visitor to the desired page but with the base ZC uri?

I use the insert SQL statment to insert that information in the table
uri

language_id current_uri main_page query_string_parameters associated_db_id alternate_uri redirection_type_code [IMG]http://discounthomeoffice.com:2082/cpsess6725793492/3rdparty/phpMyAdmin/themes/dot.gif[/IMG] date_added
/latest-offers 1 0 specials NULL NULL NULL NUL 2017-06-05 11:26:00

The products/category pages are working fine but still have some pages like specials, contact us, shipping and return that shows index.php?main_page= in the url and my understanding that these pages need to be added to the table manually.

  • Please note: There is no admin interface for entering these URI mappings in this module, they have to be entered manually (using software such as PHPMyAdmin).
6 Jun 2017, 12:25 AM
#2113
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

The issue is that current_uri is set to false (0) which means that the program will "respect" the uri, but will display/respond as if it was the ZC default version of it or find the version that exists as the current_uri (value of 1).

You are correct that these type uris if desired to be used must be manually added. Or rather added from outside of the base code of the version available from this website.

6 Jun 2017, 12:47 AM
#2114
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

mc12345678:

The issue is that current_uri is set to false (0) which means that the program will "respect" the uri, but will display/respond as if it was the ZC default version of it or find the version that exists as the current_uri (value of 1).

You are correct that these type uris if desired to be used must be manually added. Or rather added from outside of the base code of the version available from this website.

Thanks, the 1 did it. Thank you.

7 Jun 2017, 8:14 PM
#2115
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

I'm having issues with 2 of my 3 domains not working now that I installed CEON. I've narrowed it down to the htaccess file.

My hosting file structure is set up as:
/maindomain (zen files under this location)
/maindomain/_aa_domain_2 (2nd hosted website files)
/maindomain/_bb_domain_3 (3rd hosted website files)

My htaccess is:

ErrorDocument 404 /404.shtml 
RewriteCond %{HTTP_HOST} ^www\.maindomain\.com$
RewriteRule ^/?$ "http\:\/\/maindomain\.com\/" [R=301,L]

## 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 _aa_domain_2 directory
RewriteCond %{REQUEST_URI} !^/_aa_domain_2/ [NC]

# Don't rewrite _bb_domain_3 directory
RewriteCond %{REQUEST_URI} !^/_bb_domain_3/ [NC]

# Handle all other URIs using Zen Cart (its index.php) 
RewriteRule .* index.php [QSA,L]



## END CEON URI MAPPING REWRITE RULE

As it is above, the main domain works but the 2 other domains return:
Not Found
The requested URL /maindomain/index.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

If I comment out the last line, the other 2 domains work but it crashes the main domain:
#RewriteRule .* index.php [QSA,L]

I'm hoping someone can offer some assistance on the proper code to use to prevent this issue.

Regards

7 Jun 2017, 9:34 PM
#2116
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

idc1:

I'm having issues with 2 of my 3 domains not working now that I installed CEON. I've narrowed it down to the htaccess file.

My hosting file structure is set up as:
/maindomain (zen files under this location)
/maindomain/_aa_domain_2 (2nd hosted website files)
/maindomain/_bb_domain_3 (3rd hosted website files)

My htaccess is:

ErrorDocument 404 /404.shtml
RewriteCond %{HTTP_HOST} ^www.maindomain.com$
RewriteRule ^/?$ "http://maindomain.com/" [R=301,L]

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 _aa_domain_2 directory

RewriteCond %{REQUEST_URI} !^/_aa_domain_2/ [NC]

Don't rewrite _bb_domain_3 directory

RewriteCond %{REQUEST_URI} !^/_bb_domain_3/ [NC]

Handle all other URIs using Zen Cart (its index.php)

RewriteRule .* index.php [QSA,L]

END CEON URI MAPPING REWRITE RULE

> 
> As it is above, the main domain works but the 2 other domains return:
> Not Found
> The requested URL /maindomain/index.php was not found on this server.
> Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
> 
> If I comment out the last line, the other 2 domains work but it crashes the main domain:
> #RewriteRule .* index.php [QSA,L]
> 
> I'm hoping someone can offer some assistance on the proper code to use to prevent this issue.
> 
> Regards
There are other ways to do this, but because htaccess rules "inherit" upwards, your secondary site(s) are being affected by the htaccess in the primary site. Therefore, one way to eliminate that is to preclude the secondary sites from the rule testing such as the two lines added before which would need to be modified to suit your "scheme".

ErrorDocument 404 /404.shtml
RewriteCond %{HTTP_HOST} ^www.maindomain.com$
RewriteRule ^/?$ "http://maindomain.com/" [R=301,L]

BEGIN CEON URI MAPPING REWRITE RULE

RewriteEngine On

Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])

RewriteCond %{ HTTP_HOST} !^www.othersite1.com [NC]
RewriteCond %{ HTTP_HOST} !^www.othersite2.com [NC]
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 _aa_domain_2 directory

RewriteCond %{REQUEST_URI} !^/_aa_domain_2/ [NC]

Don't rewrite _bb_domain_3 directory

RewriteCond %{REQUEST_URI} !^/_bb_domain_3/ [NC]

Handle all other URIs using Zen Cart (its index.php)

RewriteRule .* index.php [QSA,L]

END CEON URI MAPPING REWRITE RULE

8 Jun 2017, 5:01 PM
#2117
idc1 avatar

idc1

Zen Follower

Join Date:
Jul 2011
Posts:
139
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

mc12345678:

There are other ways to do this, but because htaccess rules "inherit" upwards, your secondary site(s) are being affected by the htaccess in the primary site. Therefore, one way to eliminate that is to preclude the secondary sites from the rule testing such as the two lines added before which would need to be modified to suit your "scheme".

ErrorDocument 404 /404.shtml
RewriteCond %{HTTP_HOST} ^www.maindomain.com$
RewriteRule ^/?$ "http://maindomain.com/" [R=301,L]

BEGIN CEON URI MAPPING REWRITE RULE

RewriteEngine On

Don't rewrite any URIs ending with a file extension (ending with .[xxxxx])

RewriteCond %{HTTP_HOST} !^www.othersite1.com [NC]
RewriteCond %{HTTP_HOST} !^www.othersite2.com [NC]
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 _aa_domain_2 directory

RewriteCond %{REQUEST_URI} !^/_aa_domain_2/ [NC]

Don't rewrite _bb_domain_3 directory

RewriteCond %{REQUEST_URI} !^/_bb_domain_3/ [NC]

Handle all other URIs using Zen Cart (its index.php)

RewriteRule .* index.php [QSA,L]

END CEON URI MAPPING REWRITE RULE



Thank you. This worked like a charm.
8 Jun 2017, 6:25 PM
#2118
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Ceon URI Mapping v4.x

idc1:

Thank you. This worked like a charm.

Glad that it did. BTW, in review of your tagline:

ZC 1.5.5
Add ons: - Column/Grid 1.3.8 - Dual pricing 1.7 - ImageHandler3

You should update to at least ImageHandler4 with using any ZC 1.5.x version of ZC. On a side note to that, the information in the tagline doesn't help anyone reading about issues (in the future) that you may post about. The tagline if updated will update throughout the forum website and no longer apply to the conditions referenced by any such post. This is also why it is requested to post the system conditions when attempting to address an issue. It helps in a number of ways: what currently may be the source of the issue, later what may have had a similar problem that relates to other software having the same issue and even better what resolved that issue.

Anyways, glad that the problem was resolved with at least one method of resolution. :)

18 Jun 2017, 3:31 PM
#2119
pixelpadre avatar

pixelpadre

Suspended

Join Date:
Jun 2007
Location:
Eustis, Florida, USA, EARTH
Posts:
868
Plugin Contributions:
0

Re: Ceon URI Mapping v4.x

I have a bucket load of errors in the admin check ceon installation.

A file requires 2 modifications to be made for it but none of the modifications have been made.

I have tried both github and ZC downloads and I get the same errors on 155e. I am using php 5.6.3. I have created the .htaccess file in root and pasted recommended rewrite rules. When I look at my zc150 site I have all of the referenced error files present. So after installing the latest CEON URI Mapping on zc155e, some of the files are completely missing when I run the check installation.

Is this not compatible with 155e? If not, are there plans to make it compatible with future ZC releases?

Thanks

18 Jun 2017, 4:01 PM
#2120
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Ceon URI Mapping v4.x

If they are the 2 html_output files, and you are using the files from github, in the readme you will see that those 2 files no longer require editing although the installer check script hasn't been adjusted yet. So you can ignore those 2 warnings. I have this running correctly on 1.5.5e, although it seems some other modification I did after has buggered up ezpages being rewritten, but that's for another post if I can't figure it out...