Thread: Page redirects

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Sep 2009
    Posts
    16
    Plugin Contributions
    0

    Default Page redirects

    I am using zen-cart 1.3.9c but I was previously using a software to blend zencart into Joomla. It was far more hassle than the worth of it so I have now transferred the site out of Joomla back into a standalone Zen-Cart install.

    Here's my problem, when I put the standalone site live it will have slightly different urls than thd zen-cart/joomla version had so google will have a freak out with lots of page not found errors. The seo urls are still being created almost the same, the differences are quite small.

    I want to redirect all the old urls to the new urls before I make this site live.

    There are two differences between the old and new urls. First difference is that the shop used to be in /shop/ directory and is now in the root. The other difference is all the old urls used to end in .html and now they don't.

    Examples would be

    OLD /shop/childrens-housewares/bookends/cupcake-bookends.html
    NEW /childrens-housewares/bookends/cupcake-bookends


    another one

    OLD /shop/classic-films/et-mug.html
    NEW /classic-films/et-mug

    As you can see the new urls are almost the same with just minor differences. If it was just a case of being in the root instead of the /shop directory I know how to do it but because it is also loosing the .html form the end I'm a bit lost. I investigated a bit and tried adding RewriteRule ^/shop/(.*).html$ /$1 [R,L] to the end of my .htaccess file but it doesn't work. Anybody else got any ideas?


    Any help would be much appreciated

    Thanks in advance for any help you can offer

    Huw

  2. #2
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,378
    Plugin Contributions
    9

    Default Re: Page redirects for Zen-Cart

    If you have cPanel installed on your server you could do your redirects there using a wildcard. Check the help file/forum of cPanel.

  3. #3
    Join Date
    Sep 2009
    Posts
    16
    Plugin Contributions
    0

    Default

    Quote Originally Posted by frank18 View Post
    If you have cPanel installed on your server you could do your redirects there using a wildcard. Check the help file/forum of cPanel.
    I didn't think that would work because as well as redirecting an entire directory to root I also need to remove the .html from the end. How would you do that on cpanel?
    Posted via Mobile Device

  4. #4
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    984
    Plugin Contributions
    6

    Default Re: Page redirects for Zen-Cart

    I rebuilt the 40 odd .html pages from my old site to zc using the About_us mod, that also involved editing

    includes/templates/mytemplate/common/header
    includes/templates/mytemplate/common/footer
    includes/languages/english/mytemplate/meta-tags.php

    and possibly a few others that I cannot recall right now.

    The entire process was quite straightforward and painless, and gave me a chance to improve upon what existed. I am glad I did it this way as it now makes updating so much easier.

    My only lingering uncertainty is the original index.html, which is substantially different to the shopfront index.php and which I had to preserve as it contains content and layout not easily incorporated into the ZC cms. But that is another story.

    I am not really worried about my SE ratings as my content is quite unique, regularly featured in the top ten, and will continue to act as the major drawcard to my shop - a strategy I thoroughly recommend.

  5. #5
    Join Date
    Sep 2009
    Posts
    16
    Plugin Contributions
    0

    Default Re: Page redirects for Zen-Cart

    How did the about us mod redirect pages? All my pages are still there but they have slightly different urls so want to do a mass redirect. Could you possibly link to the mod that you used please?

  6. #6
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    984
    Plugin Contributions
    6

    Default Re: Page redirects for Zen-Cart

    The mod doesn't redirect anything.

    http://www.zen-cart.com/index.php?ma...roducts_id=182

    I was assuming your static pages were based more on information than sales. If so, my bad.

  7. #7
    Join Date
    Sep 2009
    Posts
    16
    Plugin Contributions
    0

    Default Re: Page redirects

    Posted via Mobile Device

  8. #8
    Join Date
    Sep 2009
    Posts
    16
    Plugin Contributions
    0

    Default Re: Page redirects

    Oh rite I see what you meant. Thanks for that but it's the sales pages that need redirecting. The static pages weren't important, there were only a couple really.

    Again, thanks for trying to help though :)
    Posted via Mobile Device

  9. #9
    Join Date
    Mar 2010
    Location
    UK
    Posts
    445
    Plugin Contributions
    0

    Default Re: Page redirects

    Your required redirect should look something like this:
    Code:
    RewriteRule ^shop/(([^/]+/)*)([^/.]+)\.html$ http://www.example.com/$1$3 [R=301,L]
    Make sure this code appears before your non-www to www canonical redirect, and that all redirects are listed before any rewrites.

    Add a question mark after the target URL if you also need to always clear all appended query string data.

    You might also be interested in the code in http://www.zen-cart.com/forum/showthread.php?t=151606 too.

  10. #10
    Join Date
    Sep 2009
    Posts
    16
    Plugin Contributions
    0

    Default Re: Page redirects

    Thanks for the reply, I actually used

    RewriteRule ^shop/(.*).html$ /$1 [R,L]

    (one less / than my original attempt) is there any advantage to using the one you have posted up?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Admin page redirects to alert page
    By lakepantim in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 21 Oct 2010, 04:38 AM
  2. Timed page redirects
    By 0be1 in forum General Questions
    Replies: 7
    Last Post: 7 Jul 2008, 05:49 PM
  3. Page Redirects
    By andy in forum General Questions
    Replies: 6
    Last Post: 26 Mar 2008, 09:00 PM
  4. Home redirects to Product Page
    By Moose408 in forum General Questions
    Replies: 3
    Last Post: 3 Oct 2006, 09:33 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