SEO 1 Links

  SEO Blog
  SEO Forum

  Active Topics
  Register
  Memberlist
  FAQ
  Search




SEO Forums

  SEO Forum
  SEM Forum

  Directories
  Link Networks
  Mod Rewrite
  Content
  Revenue Networks

  Marketing
  Social Bookmarking
  Webmastering

  Google
  Yahoo
  MSN

  Search
  Engines

  Link Exchange



Welcome

Time Now:
Wed Nov 22, 2017 11:25 am

All times are GMT

Log in

Username:

Password:

 





 





Who is Online



Most users ever online in a day was 2917 on Thu Oct 25, 2007 4:43 pm
 



Member Websites

Free Sitewide Links
For Top Members





SEO 1 Forums > Mod Rewrite >

[Moved Catalog] i need a little htaccess redirect help



Author Thread
adrenalinepcs
Preferred Member


Joined: 08 Apr 2005
Good Posts: 108

[Moved Catalog] i need a little htaccess redirect help  Reply with quote  

Iím not an expert with htaccess files and i need a little help.
Right now i have a client who moved his shopping cart from /catalog/ to the root dir. a lot of the old links point to the catalog dir so i added this:
Redirect /catalog/ http://www.hissite.com/

It works ok but... all the product pages have new ids and different urls so his old product urls go the wrong product.

So if someone types in http://www.hissite.com/catalog/product_info.php?pid=13
It redirects to
http://www.hissite.com/product_info.php?pid=13

But i want it to redirect to
http://www.hissite.com/

Can anyone tell me how to do this?


Website Design & Scripting - Adrenalinepcs - My-Health-Store
Post Sun Apr 24, 2005 2:38 pm
 View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Andrew
Senior Member


Joined: 21 Feb 2005
Good Posts: 997
Location: apache/domlogs
 Reply with quote  

I'm not sure if this is what you want, but it would be better than a 404...

code:


RewriteEngine On
RewriteRule ^catalog/product_info.php$ /



Post Mon Apr 25, 2005 9:33 pm
 View user's profile Send private message Visit poster's website
adrenalinepcs
Preferred Member


Joined: 08 Apr 2005
Good Posts: 108

 Reply with quote  

i fixed my problem with a php script.

here is what i did:

code:
<?php
$newurl = 'http://www.remmeer.com/';


   if($_GET['cPath']){
switch ($_GET['cPath']) {
case '1': $newurl = 'http://www.remmeer.com/cat-bowls-c-21.html'; break;
case '115': $newurl = 'http://www.remmeer.com/cat-toys-treats-c-1.html'; break;
case '117': $newurl = 'http://www.remmeer.com/dog-bowls-c-2.html'; break;
case '118': $newurl = 'http://www.remmeer.com/dog-clothing-c-3.html'; break;
case '106': $newurl = 'http://www.remmeer.com/dog-toys-treats-c-22.html'; break;
default: $newurl = 'http://www.remmeer.com/';  break;
}}


   if($_GET['products_id']){
switch ($_GET['products_id']) {
case '235': $newurl = 'http://www.remmeer.com/breed-apart-cat-sculptures-archie-p-213.html'; break;
case '236': $newurl = 'http://www.remmeer.com/breed-apart-cat-sculptures-clawed-p-214.html'; break;
case '240': $newurl = 'http://www.remmeer.com/breed-apart-cat-sculptures-cleo-p-215.html'; break;
case '237': $newurl = 'http://www.remmeer.com/breed-apart-cat-sculptures-pickles-p-217.html'; break;
case '239': $newurl = 'http://www.remmeer.com/breed-apart-cat-sculptures-smudge-p-218.html'; break;
case '234': $newurl = 'http://www.remmeer.com/breed-apart-cat-scupltures-spatz-p-219.html'; break;
case '164': $newurl = 'http://www.remmeer.com/adjustable-nylon-paw-print-dog-collars-p-107.html'; break;
case '145': $newurl = 'http://www.remmeer.com/bettie-fetch-and-chew-dog-toys-p-83.html'; break;
case '249': $newurl = 'http://www.remmeer.com/designer-ceramic-dog-bowls-puppuccino-p-33.html'; break;
case '248': $newurl = 'http://www.remmeer.com/designer-cat-bowls-caffe-cat-p-30.html'; break;
case '149': $newurl = 'http://www.remmeer.com/cat-lover-rugs-wipe-your-paws-p-130.html'; break;
case '264': $newurl = 'http://www.remmeer.com/cat-loverís-bathroom-accessories-p-155.html'; break;
case '263': $newurl = 'http://www.remmeer.com/cat-loverís-ceramic-kitchen-accessories-p-137.html'; break;
case '92': $newurl = 'http://www.remmeer.com/cat-memorial-paw-print-stepping-stone-kits-p-112.html'; break;
case '81': $newurl = 'http://www.remmeer.com/nostalgic-metal-cat-signs-cat-and-housekeeper-p-157.html'; break;
default: $newurl = 'http://www.remmeer.com/';  break;
}}

   
header("HTTP/1.1 301 Moved Permanently");
header("Location: $newurl");
exit();

?>





Website Design & Scripting - Adrenalinepcs - My-Health-Store
Post Tue Apr 26, 2005 12:27 am
 View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger

Reply to topic
Jump to:  
Display posts from previous:      






SEO 1 © 2005-2015 - SEO 1 the SEO Forum