UK SEO and Internet Marketing Forums
Redirect Help

December 02, 2008, 07:07:38 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: We are back and we've changed software
 
   Home   Help Search Login Register  
Del.icio.us Digg FURL FaceBook Stumble Upon Reddit SlashDot

Pages: [1]
  Print  
Author Topic: Redirect Help  (Read 232 times)
BabyChicken4u2
Colonel
*****

Karma: +2/-0
Offline Offline

Posts: 1109


PRO Webs Ecommerce Development


View Profile WWW
« on: October 25, 2007, 11:45:29 AM »

I am moving a very large site to new hosting and new design. I would like to redirect the following url formats...But they are rather odd urls.

The category urls are like this...

/hypercart/category.asp?category=103
/hypercart/Category.asp?intPage=2&Category=103
/hypercart/category.asp?category=27
/hypercart/Category.asp?intPage=2&Category=27

Product urls like this
/hypercart/pictureframe.asp?Sku=drm7020&categoryID=27
/hypercart/pictureframe.asp?Sku=FSKU%2D4V&categoryID=103

The category urls will be redirected to the new main similar category page, regardless of their page number.

The product pages will also be redirected to their corresponding new main category page.

This is a pretty hearty job as there are over 1500 urls to redirect, so I would like to use a rewrite or wild card to redirect them and keep the server speed up by not weighting down the config with a ton of commands.

Any help would be appreciated. The redirects must also be 301's as the category pages have very good backlinks and Page Rank, that I would very much like to save. Also they will directed to the www. canonical version of the site's url.

--Melanie
Logged

gabs
Captain
*****

Karma: +0/-0
Offline Offline

Posts: 213



View Profile
« Reply #1 on: October 25, 2007, 12:39:26 PM »

I'd do it in a header include in asp..

Something like this:

Code:
if LCase(Request.ServerVariables("SCRIPT_NAME"))="/category.asp" then

page2=Request.QueryString("Category")
page2="/hypercart/Category.asp?categoryID="&trim(page2)


Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.newdomain.com/"&page2
Response.end()
end if

And so on ..

This script MUST be b4 and output on the page or its will not work...

Hope that helps..
Logged

seo junkie...

mi blog init: http://www.seohome.co.uk/
BabyChicken4u2
Colonel
*****

Karma: +2/-0
Offline Offline

Posts: 1109


PRO Webs Ecommerce Development


View Profile WWW
« Reply #2 on: October 25, 2007, 01:20:19 PM »

Sorry should have been more pointed about this need a redirect for my config file....Apache

Thanks  :lol:
Logged

gid
Major
*****

Karma: +2/-0
Offline Offline

Posts: 554



View Profile
« Reply #3 on: October 26, 2007, 12:08:57 PM »

I think this is what you are asking.  Below I am redirecting any query string that has a "sort=" in it to its base page.  I also remove the query string.


To see it in action try this url:

foxdenlane.com/store/mei-tai-kozy-carrier-mei-tai-c-4_12_36.html?sort=456

Code:
# Removing Sorting QueryStrings
RewriteCond %{QUERY_STRING} sort=
RewriteRule (.*) http://foxdenlane.com/store/$1? [R=301,L]

Does this help?
Logged

My wife and I run a store where we sell Baby Slings and Carriers.  We also have a wide variety of Baby Wraps.
Other Projects:
My latest project is the babywearing.com forum.
BabyChicken4u2
Colonel
*****

Karma: +2/-0
Offline Offline

Posts: 1109


PRO Webs Ecommerce Development


View Profile WWW
« Reply #4 on: October 26, 2007, 02:53:56 PM »

Well if the DNS ever resolves I will get a look at what the final urls I will know if it will work for sure...Thanks a bunch!
Logged

BabyChicken4u2
Colonel
*****

Karma: +2/-0
Offline Offline

Posts: 1109


PRO Webs Ecommerce Development


View Profile WWW
« Reply #5 on: October 26, 2007, 09:22:30 PM »

Hey Gid that worked great except...the only way I can find to grab the parameters within the old urls is the category numbers

But when I do that it also grabs numbers from the new urls and redirects them as well.

Is there a way to add an additional match to the end of that line besides =125 for example...But not connected within the old url.

Like I could make it grab asp and the category number...That would nail it, as the new hosting is Linux.

Something like below, but I don't know the expression to make it fly.

Code:
# Removing Sorting QueryStrings
RewriteCond %{QUERY_STRING} =155 asp
RewriteRule (.*) http://foxdenlane.com/store/$1? [R=301,L]

 Posted: Thu Oct 25, 2007 6:45 am    Post subject: Redirect Help

--------------------------------------------------------------------------------
 
I am moving a very large site to new hosting and new design. I would like to redirect the following url formats...But they are rather odd urls.

The category and products urls are like this...

/hypercart/category.asp?category=103
/hypercart/Category.asp?intPage=2&Category=103
/hypercart/category.asp?category=27
/hypercart/Category.asp?intPage=2&Category=27
/hypercart/pictureframe.asp?Sku=drm7020&categoryID=27
/hypercart/pictureframe.asp?Sku=FSKU%2D4V&categoryID=103
/pictureframe.asp?Sku=TV44&categoryID=76
/hypercart/category.asp?category=103
/hypercart/category.asp?category=76
/hypercart/pictureframe.asp?Sku=40+dollar+prepaid+card+plus+receiver&categoryID=130
/hypercart/Category.asp?intPage=2&Category=174

So I eliminated using "category"...as he coded with bot capitol and non capitol "c".  hypercart only covers category pages...and not all of them, some are different.  Same with pictureframe.  Sku is not present in the category pages. The new cart uses the =125 format within the urls and obviously the ? marks as well.

I will go all same category pages and product to the new category main page.  The category main pages from the old site are the most important...the largest percentage of them even have equal PR to the main page....They are the workhorses and backbone to the site.

Thanks
--Melanie
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by SMF | SMF © 2006-2008, Simple Machines LLC | Sitemap Valid XHTML 1.0! Valid CSS!


Google visited last this page November 15, 2008, 03:13:59 PM