Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2013
    Location
    Warren, Oregon
    Posts
    117
    Plugin Contributions
    0

    Default Directory Change Worked! Now I need a Redirect

    Thanks to the sage advice to my question in thread 214069 above (Please Review My Directory Change Plan), I now have an operational installation under my root directory. I did it by copying - not moving -the contents of .../catalog/... to public_html. Made the changes in both configure.php files and everything works !

    Now I would like to Redirect any inquiries from www.heirloomstocherish.com/catalog to www.heirloomstocherish.com. Do I add some code to a preexisting .htaccess file or do I create a new one? If I create a new one, where do I put it?

    As of right now I have two functional installations, and desperately want to get down to only one, as the longer this goes the more the two installs will diverge with customer activity!

    Thanks,
    Phil

  2. #2
    Join Date
    Jul 2012
    Posts
    16,735
    Plugin Contributions
    17

    Default Re: Directory Change Worked! Now I need a Redirect

    Quote Originally Posted by Phil Soth View Post
    Thanks to the sage advice to my question in thread 214069 above (Please Review My Directory Change Plan), I now have an operational installation under my root directory. I did it by copying - not moving -the contents of .../catalog/... to public_html. Made the changes in both configure.php files and everything works !

    Now I would like to Redirect any inquiries from www.heirloomstocherish.com/catalog to www.heirloomstocherish.com. Do I add some code to a preexisting .htaccess file or do I create a new one? If I create a new one, where do I put it?

    As of right now I have two functional installations, and desperately want to get down to only one, as the longer this goes the more the two installs will diverge with customer activity!

    Thanks,
    Phil
    You would modify (if available) the .htaccess in your public_html directory. (If one does not exist, then you would create it). You can't have two .htaccess files in the same directory, and eventually you will want to remove the old one. You could also somewhat fool the system I think by setting the sub-directories includes/configure.php file to point at all things in your root directory, but yes you will want to redirect the subdirectory to your root directory and include the appropriate code to indicate a permanent move.

    The other thing is that if both stores are pointing to the same database, then the only real divergence would occur when adding products as the images may get saved to the "wrong" directory. But then again if all things point to the root directory that shouldn't be an issue either. So then the divergence would occur on updating files with say new plugins...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Sep 2013
    Location
    Warren, Oregon
    Posts
    117
    Plugin Contributions
    0

    Default Re: Directory Change Worked! Now I need a Redirect

    I have changed code in the root .htaccess file as follows:

    Redirect 301 http://mystore/catalog/index.php http://mystore/index.php

    but that doesn't seem to work. Did I code it wrong?

  4. #4
    Join Date
    Jul 2012
    Posts
    16,735
    Plugin Contributions
    17

    Default Re: Directory Change Worked! Now I need a Redirect

    Quote Originally Posted by Phil Soth View Post
    I have changed code in the root .htaccess file as follows:

    Redirect 301 http://mystore/catalog/index.php http://mystore/index.php

    but that doesn't seem to work. Did I code it wrong?
    Yes, that is wrong.

    I usually have to "pull out the books" to work .htaccess rewrites, because they are one thing where you just set it and forget it until something new comes along.

    The jest is this: need to turn on the rewrite engine I think it is, need to review the conditions being sent to the server, if the condition meets your subdirectory then it needs to remove the subdirectory from the path and continue processing with the remainder of the url, with the 301 and to possibly stop processing more rules.

    I have an .htaccess in my store's root that includes all of the appropriate statements, but I don't have access to that at the moment.

    The code that goes into the htaccess is something like another programming language. So it's not "bad" enough to have to know php, but there is also html, css, sql, javascript, and whatever language is needed to deal with htaccess work. :)
    Last edited by mc12345678; 31 Jul 2014 at 03:07 AM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Sep 2013
    Location
    Warren, Oregon
    Posts
    117
    Plugin Contributions
    0

    Default Re: Directory Change Worked! Now I need a Redirect

    What if I were to change the index.php file itself under http://mystore/catalog to point at http://mystore the minute the index filed is opened? Looks like that's where the application starts...

    Please advise

    ...and thanks for trying to help me!

    Phil

  6. #6
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Directory Change Worked! Now I need a Redirect

    Quote Originally Posted by Phil Soth View Post
    I have changed code in the root .htaccess file
    You said you "changed" something. What was it *before*?

    Quote Originally Posted by Phil Soth View Post
    Redirect 301 http://mystore/catalog/index.php http://mystore/index.php

    but that doesn't seem to work. Did I code it wrong?
    If you're using just a simple "Redirect 301", then the following MIGHT work:

    Redirect 301 /catalog/index.php http://mystore/index.php
    Redirect 301 /catalog/ http://mystore/

    (The second line is to catch other things like ipn_main_handler.php and the other .html files etc in the root, which if you forgot to update elsewhere might cause unexpected problems if you didn't have this catchall.)

    You could possibly write something more sophisticated using RewriteCond and RewriteRule directives with Regex patterns, but those may not be necessary. And I always have to pull out the books to figure those out, so I'm not gonna try to write one here off the top of my head.
    There are other folks who claim to be SEO gurus that ought to be experts on these things, so ask them and make them work for their money.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Sep 2013
    Location
    Warren, Oregon
    Posts
    117
    Plugin Contributions
    0

    Default Re: Directory Change Worked! Now I need a Redirect

    DrByte, you are genius! That worked exactly how I wanted it to!

    Couple minor issues, but they are easily solvable....I can't log in to my catalog/Admin, but why would I want to...after all, I'm the only one needing access to it and I can get there through my root admin. The other issue is the CC and SSL icons don't display because they were coded in the myshop/common/tpl_header.php which of course is no longer referenced with the Redirect - easy to change!

    The pre-change .htaccess coded I was referring to was what I used when my Zen Cart was still under development and was slowly replacing the Front Page application (guffaws, do I hear?)

    Tha code redirected a customer from my FP site to my ZC site, and worked fine. Now it's time to move forward..

    The code was
    # -FrontPage-

    Redirect 301 http://myshop/catalog/index.php /index.htp

    Again, thanks to both mc12345678 and DrByte for your support and interest in my issue!
    Phil

 

 

Similar Threads

  1. Html editor only worked once. Now nothing
    By TerryW in forum Customization from the Admin
    Replies: 10
    Last Post: 19 Jan 2011, 04:20 PM
  2. Change directory and now image uploads don't work
    By audleman in forum Installing on a Windows Server
    Replies: 3
    Last Post: 26 Feb 2008, 07:50 PM
  3. someone worked on my store~ now off center
    By smalltownpets in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 15 Jan 2007, 03:44 AM
  4. EP Upload worked - now products not found when clicked
    By www35814 in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 30 Nov 2006, 08:08 AM
  5. Directory Change, Now no cookies/sessions
    By helmetman in forum General Questions
    Replies: 5
    Last Post: 30 Sep 2006, 07:53 PM

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