Page 1 of 3 123 LastLast
Results 1 to 10 of 28
  1. #1
    Join Date
    Feb 2010
    Location
    New South Wales, Australia
    Posts
    228
    Plugin Contributions
    0

    Default Root or subdirectory?

    There is a bit of conflicting advise about whether it is better to have your zen cart store in the root (public_html) or in a subdirectory such as /shop/ with a RewriteRule to get www.domainname.com to go to www.domainname.com/shop/.
    Code:
    RewriteRule ^index\.php$ /shop/ [L]
    I thought having it in a subdirectory made it easier for upgrades. Or is it better for performance and/or SEO to have it in the root?

  2. #2
    Join Date
    Feb 2010
    Location
    New South Wales, Australia
    Posts
    228
    Plugin Contributions
    0

    Default Re: Root or subdirectory?

    Or is it better to change your domain root from public_html/ to public_html/shop/ ??

  3. #3
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Root or subdirectory?

    Here's my understanding of the various methods discussed. Running the default store has nothing to do with upgrading. By that I mean, there is no reason to plan where uput your live site to accomodate something about upgrading. How you build on it, yes, but not where it runs day-to-day. Ideally when upgrading, you leave your live site alone, build what will look like your new site, then make some changes to bring the new live site online. The specific details are addressed in other documents.

    So, that one addressed.

    I won't speak on the SEO part, I'm like a few others, there are those that state the importance of or not... Etc. But I will say, how many times should a visitor be sent on to the next location before they end up on the site? By that meaning, directing the url to a sub-directory via htaccess for example, really is pretty much a waste, also in part doesn't it seem odd to type in one address and land on another? Or for the address naming convention to change from location to location?

    As for redirecting the uri to a sub-directory so that the guest doesn't know about it, but the store owner and host does, well works/makes it easy to have multiple sites run from the same server (has it's own issues) by each url pointing to a different sub-directory on the same machine (how much is comingled?) A potential downfall (or two) is is that an htaccess file at the root of the public_html will likely/possibly cause trouble on both sites, and 2 the potential security issue(s) of one individual having access to more than one site at a time.

    That's just my take on it.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Feb 2010
    Location
    New South Wales, Australia
    Posts
    228
    Plugin Contributions
    0

    Default Re: Root or subdirectory?

    Quote Originally Posted by mc12345678 View Post
    Here's my understanding of the various methods discussed. Running the default store has nothing to do with upgrading. By that I mean, there is no reason to plan where uput your live site to accomodate something about upgrading. How you build on it, yes, but not where it runs day-to-day. Ideally when upgrading, you leave your live site alone, build what will look like your new site, then make some changes to bring the new live site online. The specific details are addressed in other documents.
    The only reason I thought it would be best would be to have the new site in say /shop_test/ and then it is easy to move it to the live store by simply changing the current live site directory to /shop_old/ and the new /shop_test/ to /shop/ (and changing the config files). No need to copy the new files to the root. Am I missing something? I currently have the redirect:
    Code:
    RewriteCond %{HTTP_HOST} ^MYDOMAIN\.com\.au$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.MYDOMAIN\.com\.au$
    RewriteRule ^/?$ "http\:\/\/www\.MYDOMAINl\.com\.au\/store\/" [R=301,L]
    Is this bad? I just don't know....
    Last edited by robbie269; 12 Aug 2014 at 05:32 AM.

  5. #5
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Root or subdirectory?

    Quote Originally Posted by robbie269 View Post
    The only reason I thought it would be best would be to have the new site in say /shop_test/ and then it is easy to move it to the live store by simply changing the current live site directory to /shop_old/ and the new /shop_test/ to /shop/ (and changing the config files). No need to copy the new files to the root. Am I missing something? I currently have the redirect:
    Code:
    RewriteCond %{HTTP_HOST} ^MYDOMAIN\.com\.au$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.MYDOMAIN\.com\.au$
    RewriteRule ^/?$ "http\:\/\/www\.MYDOMAINl\.com\.au\/store\/" [R=301,L]
    Is this bad? I just don't know....
    How to approach this question...

    I took a look at the various instruction available in the FAQs. I saw the guidance to which you were referring that identified that it is probably easiest to simply rename directories. Another method refers to placing the store in maintenance mmode and copying over the files associated with the new site and to delete those files that nno longer exist for that version of the store.

    So there are in a sense two ways to look at things. An easy way to perform the upgrade and the way to operate the store.

    Ideally though, the uri for the store would actually point directly to the sub-directory (again there is a potential that the the root directory of the host which would be one directory above the site would contain an htaccess file that could cause trouble for the site.). This methodi believe would require at least two uris, one that points to the host's public_html, the other that is used for the store that points to the sub-directory. By pointing meaning that when www .mystore .com is entered, the store shows with that address in the browser, no sub-directory included. This is different thn your current setup, which always shows "shop" as part of the path in the browser and at no time is it possible to host a site at the root of your host's file structure.

    Generally speaking, the instructions available in the FAQ are written with the thought of providing a successful result for anyone that uses it. In the case of the instruction referenced, all server side actions are identified as an example, not necessarily something that must be done. On the same note, it's easy to run a store without adding any functionality vailable from the plugins section or template changes, and there are those that go that way. So is it "wrong"? I'd say that it can be a matter of opinion,mostly because I do not have any empirical data to suggest it is. I do see a lot of the others that provide support on this site as recommending that the store be in the root directory and thaat a redirect like above not be used.

    So, may ask how I have done things? Unfortunately, the organization with which I work can be strongly polarized by emotion. We didn't even begin to consider a sales site until our base site had been online for almost a year. At that point, we were happy to get something up, so yes we did place our store in a sub-directory, because a lot of work had gone into the base site... Now that those emotions have died down, politically it is a good idea for us to transition our store site to be our base site. To keep the information available, we are working the base site information into our ZC site, and then the base site will be replaced with our store. It *is* a bit of a slow process/not wanting to shock our customers mostly because there is a lot of thought going into placement and redesign, but it certainly is worth the replacement. In the end our customers will be able to find the information that we provide as well as to be able to provide the donations that we need.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,494
    Plugin Contributions
    88

    Default Re: Root or subdirectory?

    Quote Originally Posted by robbie269 View Post
    There is a bit of conflicting advise about whether it is better to have your zen cart store in the root (public_html) or in a subdirectory such as /shop/ with a RewriteRule to get www.domainname.com to go to www.domainname.com/shop/.
    Code:
    RewriteRule ^index\.php$ /shop/ [L]
    I thought having it in a subdirectory made it easier for upgrades. Or is it better for performance and/or SEO to have it in the root?
    Having Zen Cart installed in a subdirectory makes it immensely easier for upgrades. My preferred approach is as you indicated, install in a subdirectory and rewrite to "root".

  7. #7
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Root or subdirectory?

    Quote Originally Posted by lat9 View Post
    Having Zen Cart installed in a subdirectory makes it immensely easier for upgrades.

    Could you explain why ?

  8. #8
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Root or subdirectory?

    Quote Originally Posted by lat9 View Post
    rewrite to "root".
    I'm curious about the rewrite aspect, is this typically an htaccess rewrite as identified by the OP, or a folder that the uri is "assigned" to, or some other method?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,494
    Plugin Contributions
    88

    Default Re: Root or subdirectory?

    Quote Originally Posted by stevesh View Post
    Could you explain why ?
    When the Zen Cart is installed in a subdirectory, my normal approach to an upgrade is to create the upgrade as a peer directory. Once the upgrade is "ready for prime time", both sites go into Maintenance Mode, I rename the old directory and then rename the upgrade directory to the "live" directory. Site downtime, close to 0.

  10. #10
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,494
    Plugin Contributions
    88

    Default Re: Root or subdirectory?

    Quote Originally Posted by mc12345678 View Post
    I'm curious about the rewrite aspect, is this typically an htaccess rewrite as identified by the OP, or a folder that the uri is "assigned" to, or some other method?
    Most hosts provide a means in the cPanel to associate a URL with a directory. Under-the-covers, this is a rewrite.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 4 Sep 2014, 01:55 PM
  2. root or subdirectory?
    By fakeDecoy in forum General Questions
    Replies: 8
    Last Post: 25 Apr 2011, 06:03 PM
  3. subdirectory to root
    By stitchnkitty in forum Installing on a Linux/Unix Server
    Replies: 5
    Last Post: 31 Dec 2009, 07:13 PM
  4. Replies: 1
    Last Post: 10 Jun 2007, 09:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR