Forums / General Questions / migrate oscommerce links to zen

migrate oscommerce links to zen

Locked

Views: 1,621

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
11 Jun 2006, 12:44 AM
#1
dvdguy avatar

dvdguy

New Zenner

Join Date:
Jun 2006
Posts:
19
Plugin Contributions:
0

migrate oscommerce links to zen

I've moved a site running oscommerce to a new site with zen-cart and a slightly different domain name... both sites are running and now I want to allow spidering of the new site and redirect from the old site to the new site. The old site does not seem to have functioning htaccess files. So I figure I should add a redirect line to application_top.php in the old site. Anyone done this before?

I want to put in a line that will redirect the old site products and categories to the new site. Shouldn't be too hard but I can't think after spending a week on the migration.
The items IDs are the same, categories are the same, except I did put all the previous categories down one level.

Thanks
dvdguy adam

11 Jun 2006, 2:07 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: migrate oscommerce links to zen

To redirect a single page, the following would work from a PHP file:```php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.mynewsiteurl.com/folder/index.php");


You could likely do some detecting of URL parameters and loop thru them to determine the right new URL to go to for all your products pages.

.
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.

11 Jun 2006, 4:25 AM
#3
dvdguy avatar

dvdguy

New Zenner

Join Date:
Jun 2006
Posts:
19
Plugin Contributions:
0

Re: migrate oscommerce links to zen

Something like this? But it isn't working:

if (isset($_GET['product_id']) and $_GET['product_id'] != "") {
$prodid=$_GET['product_id'];
$hdstring="http://www.mydvdshop.com/index.php?main_page=product_info&products_id=" . $prodid;
header("HTTP/1.1 301 Moved Permanently");
header("Location: " . $hdstring);
die();

}

elseif (isset($_GET['cPath']) and $_GET['cPath'] != "") {
$prodid=$GET['cPath'];
$hdstring="http://www.mydvdshop.com/index.php?main_page=index&cPath=45
" . $prodid;
header("HTTP/1.1 301 Moved Permanently");
header("Location: " . $hdstring);
die();

}
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.mynewdvdshop.com/index.php");

The if tests ae failing and I always get the last link to index.php.

11 Jun 2006, 4:56 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: migrate oscommerce links to zen

I do believe that is $_GET['products_id'] with an S in there ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

11 Jun 2006, 5:12 AM
#5
dvdguy avatar

dvdguy

New Zenner

Join Date:
Jun 2006
Posts:
19
Plugin Contributions:
0

Re: migrate oscommerce links to zen

Yes! It works. I was wondering why my test file worked but the live file not.

Thanks