Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirection script other than error404.asp page

Status
Not open for further replies.

abovetopsecret

Programmer
Jan 16, 2008
61
GB
I have an ecommerce website that Im workign on, and my client has asked me to introduce some new stock but it needs a difefrent landing page other than the normal description page that is built into the system.

So I had this idea at first to eneter a product into the system, then once its clicked to be viewed in full it would go to a page that I built and pushed up the the root level on the server.

This is my question, I thought about using a customised error404.asp page to detect the page they looking for once they click the item, and then re-direct them to another page.

This is what i was thinking, which has come from another site.
Code:
<%
dim i, newURI, req, pageArray(1,50)

pageArray(0,0) = "long-case-mahogany.htm"
pageArray(1,0) = "Display.asp?cat=Longcase%20Mahogany&catArt=Longcase%20Mahogany"

bFound = false

for i = 0 to ubound(pageArray,2)
if pagearray(0,i) <> "" then           
    if instr(request.servervariables("QUERY_STRING"), pageArray(0,i)) <> 0 then
        req = replace(request.servervariables("QUERY_STRING"),"404;","")
          newURI = replace(req,pageArray(0,i), pageArray(1,i))
           bFound = true
     end if
end if
if bFound then exit for

next

if bFound then
' uncomment the next line to keep the original URI but show the new content
'server.transfer("/newdir/" & pageArray(1,i))
'server.transfer(pageArray(1,i))
' uncomment the next lines to redirect to the new pagename
   response.status = "301 Moved Permanently"
   response.addheader "Location", newURI
   response.end()
else
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html>
<head>
<title>Not Found</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="robots" content="noindex,nofollow">
</head>
The page you are looking for no longer exists.
<body>
</body>
</html>

<%
   response.status = "404 Not Found"
   response.end
end if
%>

But then I realised that the page they dont want it to go too will exist as its automatically done, and so the code above will not work as the page will exist.

So is there another way around it so that I can list a load of new pages against the pages I dont want it to go to, although that page does exist.

Hope it all made sense.

Thanks
 
I thought about using a customised error404.asp page to detect the page they looking for once they click the item, and then re-direct them to another page.

I must be missing something. Why not just send them to the right page in the first place?

Currently you have products. User clicks on a product and goes to a standard description template page. Now for some products you want them to go to an alternative description template page. There must be something that distingushes those products.

User clicks on product. Page logic decides whether that product needs template 1 or template 2 (consults an array, makes a database call, etc., whatever). It wouldn't matter what else exists or is 404, would it?

Just thinking out loud while waiting for the real experts to answer.


 
Hi,

Ye I know it sounds wrong, but believe me there is a reason behind it.

The reason being is that he is now affiliated with Amazon and wants to sell stock Amazon has got that best suits his stock, but as the system works he cant have them putting amazon stock into his shopping cart, instead it needs to go to Amazon, and he wants it to be advertised on his website like the rest of his stock.

I'll show you:


Go to that link and you will see at the end an advert for a DVD which im using to test. Now if the buyer wants it when he clicks on view or add I need him to go to this page, which I created myself, by pinching the URL and diverting him here.


Which will be a landing page for that advert, and the customer can then go to Amazon and pay.

Hope that is more clear
 
the original code should anyone be looking for it, is at
One day I'll write that up properly on my site.

some more of my code might be of interest as well, given that it was written specially for the issue you are facing is Redirecting (Masking) Affiliate Links



Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Hi Chris,

I've taken a look at that page and as its late, so I'll leave it until tomorrow now, but I wanted to get your opinion on the site in question and your knowledge of affiliate workings.

In your opinion is my client going to lose out from being an affiliate in the search engines and how the customers may percieve what he is doing, and do you think that my work around is the right way to market the affiliate products in this site, as I am trying to reduce the affiliate product, make the most of Amazons PR and create a very easy and comfortable purchase for the client.

Thanks
 
Absolutely nothing wrong with having an all affiliate site or affiliate links on a site, You just have to work a little bit harder to stand out from the crowd.

I should have some free time tomorrow (actually it's today now [smile] ) to have a look over the site.

also take a look at;
Forum828
HighRankings Forum
Webmaster Talk forums




Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 

The one thing to do more than anything, is to write your own descriptions for the Amazon products. It's the use of boilerplate text from the product site that dooms many affiliate pages to obscurity.

Other than that simply treat it as you would any other product and go from the individual product page to the Amazon landing page rather than from the category page.





Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Good morning ChrisHirst,

Great stuff, that is exactly what im doing, im treating each product as though its one of ours, but I need a work so that when the customer clicks the product they go to amazon and not to our description page.

But I was thinking about it last night, and by the end I will be looking at possibly over a hundred of these products, so I will need a way of efficiently pinching the URL and directing them to another page.

Just like I was asking for in the post at the start.

But thanks for keeping in touch.

 
I just read your post again, and you think I should jump directly from the product thumbnail to the amazon landing page do you, rather than me creating that page I showed you, which describes what is happening and shows all the affiliate products.
 
No, create your own landing page as you have, but with a unique description of the product. Have the thumbnails take the visitor to your landing page.
If you can script it so the product caption and image go to your landing page and the "Buy from Amazon" button takes you direct to the Amazon page so much the better.
With that scheme you can get the impulse "buy it now" purchasers and you give the "I'd like to read more" purchasers equal chance to buy from you.

Scripting both these options via a "jump" page or an AJAX script, gives you chance to track which method is more popular. In affiliate scenarios, click tracking the visitor behaviour is of paramount importance if you want to be successful.

Move your boilerplate "teamed with Amazon" disclaimer down the page and if you can script that as well to insert the product name and or some relevant keywords (without it looking contrived of course) do so.

Basically whatever you can do to reduce the duplication between pages, do.


Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Great stuff,

Im enjoying this. But I have the issue of once a product enters the database via the admin it works exactly the same as the other products, and when clicked will naturally go to the standard read more page.

My problem is how to get the system to recognise that one is an affiliate product and so does x and one is our product and does y when on the same product page.
Y product isnt the problem, its controlling x product to not go to the standard read more, but instead go to my affiliate read more page before going to amazon to purchase.

That is why I had the idea of a sort of customised error404 page that will react to a specific URL and re-direct it, and that way also I can manage a lot of these links.

Any thoughts.

Thanks again
 
Maybe there is another way of doing this...

What if I add all the affiliate products as normal, but when clicked and lands on the read more page, I add an if statement on that page that recognises specific ID's and if its one of the ID's that equal the affiliate product it takes away the option to buy from us or add to our cart, and instead in the blurb I add the amazon buy it button for the customer.

s**t

This is going to take some work!

 
s**t

This is going to take some work!

[smile]

One of the reasons I built my own catalogue / cart system rather than try to make a out of the box cart do what I wanted

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Did you build your own?

That must have taken some work?

I think I've got the best work around though.

I leave the products be, and on the system read more page, I put an if statement in there looking for ID's that are affiliate products, then it takes away the add to cart bit on that page, and instead puts some amazon blurb, and I put the buy it from amazon button in the full description bit.

That will cut down on a lot of work, but I got the hard work of all the products to go in.

One issue with this system my clcint got, is that its running of access, is it a lot of work to move this over to MySQL, or is it best to start from scratch?

 
is it a lot of work to move this over to MySQL

Hard to say without knowing the application.

It will really depend on how the queries are coded and if the database part could be rewritten to use abstraction


Most commercial cart authors tend to go with the queries being embedded in the pages rather than use functions or class methods (yep, even with VbScript. This then makes it a little more difficult to switch DB servers once the system has been set up.

If the script is coded cleanly, with the db opened and closed quickly, Access is quite capable even for moderately busy sites. The problems start to occur when db objects are not closed when finished with.

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Hi ChrisHirst,

I got a basic path working now.

If you dont mind Id like your opinion.


Click any of the products and see the read me page, then click the dvd at the bottom and see the change.

It recognises the product Id and changes the look.

Would this be ok with you?

Thanks
 
That all works pretty well. And I would say that it would be good for SEO/SEM.

One of the SEM/SEO advantages of having a landing page, is that your pages aren't loaded with affiliate links and you keep the fairly valuable anchor text "real estate" to your own site instead of squandering it off to a site that is about gaining sales via links NOT whatever benefit comes from links.

Also, should you use PPC to drive product sales (your own inventory or the affiliate products) you already have a direct landing page for the click through.


Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 



I got a basic path working now.

That is so far beyond me it isn't even funny. Pretty slick though I think. If I was a customer I would see how it works. The little blurb statement about buying some products from one place and some from another really helps.

I especially liked that when I put something in the Acorn cart and then clicked on an Amazon product the Amazon part comes up in a new window and the Acorn site and cart are still back there and I can see that they are. Customers will just have to figure out that it is two seperate purchases. That would be useful info in the blurb. "If you are purchasing products both from us and Amazon, you will need to make two separate transactions" or something to that effect so they know.


 
Hi BigRed1212,

Thanks for posting your message. Your point about the extra bit in the message is spot on, thanks for that, and I'm glad another knowledgable person likes the method I have taken to get this affiliate stuff working, and working so that the site itself benefits from it in terms of SEO.

There is one last step to go to manipulate and add to the code so that the site reacts to the product ID's, and I will more than likely post it tomorrow looking for some opinions.

Thanks again
 
Hi ChristHirst,

Whats the best way to deal with multiple if statements and having one else statement.

The full block of code is below, and as you will know I coul dhave up to 50-60 affiliate products and on that page, the code will be looking to react differently to each product Id.

Any suggestions.

Code:
<%
		if idProduct = "323" then
		%>
		<br/><br/><br/>
		<div id="AmazonAffiliate">
		<iframe src="[URL unfurl="true"]http://rcm-uk.amazon.co.uk/e/cm?t=litacogifcol-21&o=2&p=8&l=as1&asins=B000R343PI&fc1=000000&IS2=1&lt1=_blank&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr"[/URL] style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
		</div>
		<div id="WhyAmazon"><a href="[URL unfurl="true"]http://www.littleacornsgifts.co.uk/scripts/http://www.littleacornsgifts.co.uk/scripts/openPolicy.asp?policy=8"[/URL] onClick="window.open('[URL unfurl="true"]http://www.littleacornsgifts.co.uk/scripts/openPolicy.asp?policy=8','policy','height=600,width=600,top=100,left=100,scrollbars=yes,resizable=yes');return[/URL] false;" >Why am I buying this item from Amazon.co.uk?</a></div>		
		<% else %>		
			<table border=0 cellSpacing=0 cellPadding=5 width=176 class="CPbox2">
<% if pCatalogOnly = 0 then %>
				<tr>
					<td nowrap align=center class="CPbox2H">
						<b><%=LangText("GenReadyToOrder","")%></b>
					</td>
				</tr>
<% end if %>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top