Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-13-2012, 09:00 PM   PM User | #1
wallaby
New to the CF scene

 
Join Date: Mar 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
wallaby is an unknown quantity at this point
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
wallaby is offline   Reply With Quote
Old 03-20-2012, 04:33 PM   PM User | #2
wallaby
New to the CF scene

 
Join Date: Mar 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
wallaby is an unknown quantity at this point
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
wallaby is offline   Reply With Quote
Old 03-22-2012, 06:50 PM   PM User | #3
Phred
New Coder

 
Join Date: Oct 2009
Posts: 40
Thanks: 4
Thanked 0 Times in 0 Posts
Phred is an unknown quantity at this point
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?
Phred is offline   Reply With Quote
Old 03-29-2012, 08:09 AM   PM User | #4
Macek
New to the CF scene

 
Join Date: Mar 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Macek is an unknown quantity at this point
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
Macek is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:00 AM.


Advertisement
Log in to turn off these ads.