Results 1 to 6 of 6

Threaded View

  1. #4
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: htaccess redirect from old subdirectory site to new subdomain site

    Quote Originally Posted by Millie63 View Post
    ...
    Are you ready to migrate from the old store to the new store?
    Not quite ready yet, but almost there.

    Why not just move the new store directly onto "mydomain.com" (when ready)?
    That's the plan. I just didn't want to take down the old site while preparing the new store in order not to lose customers. If people have linked to the site with the old unfriendly urls, don't I have to redirect them to the new uri-mapped ones? Or would this be done automatically?
    ...
    Zen Cart is based upon what is known as the "front controller" design pattern. This essentially means all requests for a page go to a single "entry" point and then the software determines which page to show based upon the request. Most of the "human friendly" URL generation tools (including CEON URL) hook into this entry point and add additional interpretation to accommodate the requests for "human friendly" URLs.

    This means most of the tools do not require the end user to manually redirect requests for "stock" Zen Cart URLs. The "human friendly" URL tool simply handles the "human friendly" requests and modifies the request environment to supply the needed information. So requests to the following appear the same to Zen Cart's internal code:
    Code:
    /zencart/index.php?main_page=index&cPath=3_23
    /zencart/category-fruit/subcategory-apples/
    Quote Originally Posted by Millie63 View Post
    ...
    Why not just let the "URI Mapping" tool handle the previous URLs (shtml -> ez-pages)?
    The old .shtml pages were not part of the zencart before so I'm not too sure how the URI mapping tool could handle them. Do you mean naming the pages with the old .shtml names and then optimising these in the uri mapping tool?...
    "CEON URI Mapping" keeps a "history" of URLs for each "page". This means all one really needs to do is first configure (and save) the original URL (.shtml). Then one configures and save the new (desired) URL. Both alternative URIs (and the stock Zen Cart URI) are handled automatically. Most of this is covered in more detail in the README file which accompanies "CEON URI Mapping".

    Quote Originally Posted by Millie63 View Post
    ...
    Why not use a simple RewriteRule (no redirect) to handle the path (folder) change?
    This would be good to do. I should also add that the site mydomain.com is an addon domain on cpanel. Does this mean that I leave everything in shop.mydomain.com and just include a RewriteRule in the htaccess of /public_html? I'd rather have the whole cart in its own addon domain folder in order to avoid confusion. Do you think this is wise? If it is, the .htaccess should be in the root of the addon folder mydomain.com, is that right?
    mapping tool?...
    The question I would ask is "What business purpose is served by having your main website and the store on a different domain?".

    Generally I would recommend the store and the main website (especially if they share a template) being located in the same domain. This makes it obvious to customers and search engines only one company is involved. This also makes it easier to incorporate portions of Zen Cart into other pages on the site (and vice versa).

    There is one minor change one may need to make to the .htaccess file generated by CEON URI if non Zen Cart "pages" or "software" share the same domain... But the change varies by software, paths, etc... But rest assured it is a minor and easy change.

    Quote Originally Posted by Millie63 View Post
    ... Would this be correct if I put it in htaccess of addon domain folder? ...
    I'd probably just modify the Request URI and let "CEON URI Mapping" handle the canonical (and redirect if enabled).

    Assuming the store will be placed on the same domain as the original store:
    Code:
    ###############################################################################
    # Enable mod_rewrite processing using the rules in this .htaccess file
    ###############################################################################
    # Notes: 
    #
    # For mod_rewrite to work, the Apache server option to allow symbolic links to
    # be followed must be enabled. Most providers supporting mod_rewrite will
    # already have it enabled for you, but if your rewrite rules are not working
    # you can un-comment the first directive below to manually enable the option.
    #
    # Don't forget, mod_rewrite directives are processed in order until a matching
    # RewriteRule with the [L] flag is encountered. So the more specific a rule is
    # the closer it should appear to the top of this file.
    #
    # These directives should only appear once in the .htaccess file
    ###############################################################################
    #Options +FollowSymLinks
    RewriteEngine on
    
    ###############################################################################
    # Remove "/zencart" if present from the request URI
    ###############################################################################
    # Notes:
    #
    # These directives should proceed rules added by CEON URI Mapping
    ###############################################################################
    RewriteCond %{REQUEST_URI} ^/?zencart/
    RewriteRule ^(/?)zencart/(.*)$ $1$2
    Otherwise much will depend upon how exactly the "main" and "addon" domains are located and configured by the hosting provider. One may be able to apply something similar to the above, or may be forced to add the new domain name and the flags [R=301, L].

    Quote Originally Posted by Millie63 View Post
    ... Incidentally I've noticed that there's no place in ezpages where I can put manipulate the Title tag, meta keywords and descriptions. Is there a plugin for this? ..
    A quick search finds: Can I set meta tags on EZ Pages? There have been discussions about some other ways to accomplish the same result without adding a plugin. However there is also a plugin for Zen Cart 1.5.0 called EZ-Pages Meta Tag Fields (I have not personally used this, but it may fit your needs).

    Further discussion of the topic of meta tags / ez-pages would best be done in a new topic.

    Note: An easy way to search a specific site using Bing or Google is using the "site:" option. For example: "my search terms site:zen-cart.com". This is what I typically use to search the Zen Cart forums, plugins, faqs, and wiki all at once.
    Last edited by lhungil; 29 May 2014 at 05:33 PM.
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

 

 

Similar Threads

  1. v151 Need to redirect from old site links (including search engine links) too new site
    By swdynamic in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 15 Jun 2015, 04:40 AM
  2. What do I need in .htaccess to redirect to my new site?
    By marvin in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 18 Mar 2013, 09:01 PM
  3. Redirect From Old Site To New Site
    By devlin in forum General Questions
    Replies: 4
    Last Post: 14 Mar 2012, 01:25 PM
  4. v150 Redirect from old osc site to new zc site?
    By DIHI in forum General Questions
    Replies: 2
    Last Post: 2 Feb 2012, 05:42 PM

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