Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: redirect code

  1. #1
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    redirect code

    Hi,
    I am fairly new to coding so please bear with me.
    I have a situation that I need to resolve quickly and I think a redirect or rewrite will be the correct option.

    We have a website that we had to move from unexpectedly (poor host reseller) and rebuild our site on a new host and different shopping cart. basically it was a complete rebuild.

    The problem now is that although we moved two weeks ago, we are still not indexed on the new site. Site:domainname comes up with old links that are now 404.

    Old links have the url structure .com//item_295/Cancer-Awareness-Necklace-with-Peridot.htm. It's the item_ that is throwing me.

    Having scoured the net I managed to write this code, which of course does not work, then I found this forum

    this is what I put into .htaccess, where did I go wrong?

    RewriteRule ^item_([0-9])/([a-z]+)\.html$ /index.php?main_page=products_all [R=301,L]

    thanks in advance

  • #2
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    perhaps no-one understood the question so I'll ask it a different way. Why did this give me 500 error?

    RewriteEngine On
    RewriteBase /
    RewriteRule ^item_88/Susan-Pink-Ribbon-Breast-Cancer-Awareness-jewelry-magnet.htm $ index.php?main_page=product_info&cPath=103_104&products_id=310 [R,NC]

    this is a ZenCart site on a Hostgator server

  • #3
    New Coder
    Join Date
    Oct 2009
    Posts
    40
    Thanks
    4
    Thanked 0 Times in 0 Posts
    This will redirect all visitors to the old site to the index page of the new site:
    (if that is what you're trying to do)

    RewriteEngine On
    RewriteRule ^(.*)$ http://www.newdomain.com? [R=301,L]


    If you moved to another host, why aren't you using the same domain name?

  • #4
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay, I've got a code that places a button on the page, but when you click the button, it doesn't take you to the page it's supposed to.
    Vistaprint coupons


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •