Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2013
    Location
    north carolina
    Posts
    110
    Plugin Contributions
    0

    link problem Strange issue with redirecting from another website

    Hi,

    My store used to reside on another URL as part of a WordPress website (on an Apache server). This week I re-launched it at its new stand-alone Zen Cart location (also Apache) and set up htaccess Redirect 301 on the old website for all of the store pages. Alas, today I noticed that all except home page gave me 404 errors. I was able to fix product and utility pages (contact, shipping, etc.), but all category and subcategory pages are still ending up not being found. (THANK YOU for the sitemap on the "not found" page, by the way!)

    On the old website (using an OsCommerce-based plugin for WordPress), category addresses looked like this:

    /OLD_SITE/STORE/index/cpath/1/ (or whatever the category ID was)

    When categories are accessed by clicking links on the new website, they are found just fine and their URLs look like this:

    /NEW_SITE/meaningful-category-name/ (thanks to Ceon URI Mapping)

    However, when they're accessed through the redirects from the old website, they are not found and try to look like this:

    /NEW_SITE/index/cpath/1/

    I set up the htaccess Redirect 301 on the new website to send each /index/cpath/#/ to its corresponding meaningful URL, but although that solution worked for the product and utility pages, it did not work for the category/subcategory pages.

    How can I fix this please?

    Thank you,
    Magz

  2. #2
    Join Date
    Dec 2010
    Location
    UK
    Posts
    1,771
    Plugin Contributions
    3

    Default Re: Strange issue with redirecting from another website

    silly question I know, but have you done URI rewrites for your categories etc?

  3. #3
    Join Date
    Apr 2013
    Location
    north carolina
    Posts
    110
    Plugin Contributions
    0

    Default Re: Strange issue with redirecting from another website

    There are no silly questions, picandnix. ;-) I don't know much about rewrites. I'm using Ceon URI Mapping for the SEO friendly URLs, and the plugin does its own rewrites automatically. Each category/subcategory (as well as product and EZ page) has its own friendly URL that way. I'm aware that a rewrite exists to do 301 redirects, but the only way I know how to do them is in this format:
    Redirect 301 /old_url/ http://new_url

    It's working for products, but not for categories, perhaps because products had friendly URLs on the old website, while categories didn't (which was one of many reasons why I switched to Zen Cart). Still, I don't understand why my redirect instructions are being misinterpreted, I never had this problem with any other website (none of the others used ecommerce, though).

    Now...if I were to set up additional rewrites for the categories, how would I do that?

    Thanks!
    Magz

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

    Default Re: Strange issue with redirecting from another website

    Quote Originally Posted by magz View Post
    ...

    On the old website (using an OsCommerce-based plugin for WordPress), category addresses looked like this:
    /OLD_SITE/STORE/index/cpath/1/ (or whatever the category ID was)

    However, when they're accessed through the redirects from the old website, they are not found and try to look like this:
    /NEW_SITE/index/cpath/1/

    I set up the htaccess Redirect 301 on the new website to send each /index/cpath/#/ to its corresponding meaningful URL, but although that solution worked for the product and utility pages, it did not work for the category/subcategory pages.

    ...

    Redirect 301 /old_url/ http://new_url

    It's working for products, but not for categories
    ...
    If your category id's stayed the same during your migration you can add a RewriteRule before the rest of the CEON rules:
    Code:
    RewriteRule ^STORE/index/cpath/([0-9]+)/$ index\.php?main_page=index&cPath=$1&%{QUERY_STRING}
    This way CEON URI Mapping will see the URI as being in the original Zen Cart format and should attempt to redirect the old page to the new page. Note: On some hosts you will need to add an extra / to the start of the URL to be matched... "RewriteRule ^/STORE"...

    Alternatively you could set the URL of each category in CEON URI Mapping to the old store's URI, then change it back to the new store's URI. This will cause CEON URI Mapping to add the old URI to the "history" and know what the URI is matched it needs to redirect to the new location.
    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

  5. #5
    Join Date
    Apr 2013
    Location
    north carolina
    Posts
    110
    Plugin Contributions
    0

    Default Re: Strange issue with redirecting from another website

    Quote Originally Posted by lhungil View Post
    If your category id's stayed the same during your migration you can add a RewriteRule before the rest of the CEON rules:
    Code:
    RewriteRule ^STORE/index/cpath/([0-9]+)/$ index\.php?main_page=index&cPath=$1&%{QUERY_STRING}
    This way CEON URI Mapping will see the URI as being in the original Zen Cart format and should attempt to redirect the old page to the new page. Note: On some hosts you will need to add an extra / to the start of the URL to be matched... "RewriteRule ^/STORE"...

    Alternatively you could set the URL of each category in CEON URI Mapping to the old store's URI, then change it back to the new store's URI. This will cause CEON URI Mapping to add the old URI to the "history" and know what the URI is matched it needs to redirect to the new location.
    Thanks lhungil - Nope, the IDs don't match between the 2 websites. In the latter solution you propose, if an old ID 6 (for example) redirects to new category A, but the new category C now has ID 6, would that cause a problem? (I think it shouldn't as the default URLs are totally different on the 2 websites...) If not, then this would certainly be worth trying.
    Thanks,
    Magz

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

    Default Re: Strange issue with redirecting from another website

    Quote Originally Posted by magz View Post
    ... (I think it shouldn't as the default URLs are totally different on the 2 websites...) If not, then this would certainly be worth trying.
    ...
    I'd say try just changing the URLs twice on a test product - or ask in the CEON URI Mapping thread :)
    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

  7. #7
    Join Date
    Apr 2013
    Location
    north carolina
    Posts
    110
    Plugin Contributions
    0

    Default Re: Strange issue with redirecting from another website

    I did test it and it seems to be working fine. Thanks lhungil!

 

 

Similar Threads

  1. v139h Sign-on from another website?
    By Rob Musquetier in forum General Questions
    Replies: 1
    Last Post: 30 Jun 2014, 04:59 PM
  2. v139h Product Linking to another website potential issue
    By PhillipHarrison in forum General Questions
    Replies: 2
    Last Post: 30 Jan 2013, 07:05 PM
  3. redirecting from pay pal to website
    By pwilliams in forum PayPal Express Checkout support
    Replies: 2
    Last Post: 25 Jun 2009, 11:20 AM
  4. Replies: 8
    Last Post: 22 Jan 2008, 03:55 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