• John Honeck

  • EcommerceTemplates and Proper 301 Redirects in ASP

11th August 2006

EcommerceTemplates and Proper 301 Redirects in ASP

Update 8/31/06 the following codes can now be downloaded for the products, categories, and proddetail pages for 301 redirects on ecommerce templates in asp.

I love the ecommercetemplates shopping cart solution, but there is one thing that has annoyed me since I started working with them. If you have to remove a product, as often happens, the user sees a basically blank page with the note:

Sorry, this product is not currently available

Not very appealing, and doesn’t really help your customer much. Much worse however, is that if that product was indexed by a search engine and the page had some ranking, you’ve lost all value. The same message is also given if someone accidentally links to a non-existent product, or makes a mistake in the link. Often manufacturers will change a product and upgrade it to something better and you have to remove the old product and add the new product, also loosing all of your search engine credit.

We need a way to tell Google and the rest that the product the searcher was looking for is no longer available, but can be found at this new location. When we tell them that all value the old page should be saved and moved to the new page.

The 301 redirect accomplished just that mission, but now I needed to find a way to do it with the current database structure so that it was automatic. By modifying your proddetail.asp page with the following code you will have accomplished a proper 301 redirect under three different occasions.

  1. The first part deals with canonicalization. If someone reaches your site at http://yoursite.com but you really want them to use http://www.yoursite.com we redirect them to the right URL. Since you probably have dynamic pages that pass on parameters, this code accomplishes that as well. As a matter of fact this should be placed on the top of every .asp page you’ve got, I’ll show that separate code later.
  2. If you have moved a product or no longer offer a product, but would like the visitor to go to the best available choice, they will be automatically forwarded. The search engines will also transfer all value and links to the new page.
  3. If someone mistakenly types in a wrong url, or a bad link sends them to a product that doesn’t exist we will be able to send them to some navigation structure.

The following code should be placed at the top of your proddetail.asp page below the includes for the database connection and metainfo. It assumes that you are using meta descriptions and titles, and if you are not, do it now! Your search engine rankings will thank you.

<%

'This code is provided as-is with no guarantee or warranty
'It is provided for free distribution as long as these comments
'are left in place.
'Designed by www.jlh-design.com 2006

Dim Domain
Domain = lcase(request.ServerVariables("HTTP_HOST"))

If productname= "301" then
Response.Clear
Response.Status ="301 Moved Permanently"
Response.AddHeader "Location","http://" & Domain & "/proddetail.asp" & "?prod=" & productdescription
Response.End
end if

If productname= "" then
Response.Clear
Response.Status ="301 Moved Permanently"
Response.AddHeader "Location","http://" & Domain & "/categories.asp"
Response.End
end if
%>

After that is done, we need to edit the products.

If you simply delete a product they will be sent to your categories page. However, if you’d like to give them a better choice and send them to a suggested product instead open up the product that is no longer available:

  1. Leave the product ID (Reference) alone
  2. Change product status to not display
  3. Change the product name (Prod Name) to: 301
  4. Change the product description (short) to the product ID of the product you want to send them to.
  5. Save the product

Now visit the old product url, it should automatically send you to correct product.

Just to make sure everything worked Check Your HTTP Headers by entering the old product URL, you should see a 301 redirect to the new page, then a 200 at the new page. While your on that site be sure to check the other redirects. Try the URL without the WWW, and then try going to a product detail page for a product that doesn’t exist.

For the other asp pages on your site, you’ll want to redirect those as well to the www version, the following code should be entered before the first “HEAD” tag. See this post about the complete explanation of 301 redirecting for canonicalization and downloads including to the non-www version.

<%
'This code will redirect any asp page to the www version
'This code is provided as-is with no guarantee or warranty
'It is provided for free distribution as long as these comments
'are left in place.
'Designed by www.jlh-design.com 2006

Dim Domain_Name, theURL, QUERY_STRING, HTTP_PATH,TEMP_NUM
'Get domain that the page is on
Domain_Name = lcase(request.ServerVariables("HTTP_HOST"))
'Check if URL is the www version
if left(Domain_Name, 3) <> "www" Then
HTTP_PATH = request.ServerVariables("PATH_INFO")
'Check if page is default.asp if so, redirect to "/".  If other index page is used, such
'as index.asp the numbers in the right and len statement need to be changed, as well
'as the IF statment to indicate the index page.
If right(HTTP_PATH, 12) = "/default.asp" Then
TEMP_NUM = len(HTTP_PATH)-11
HTTP_PATH = left(HTTP_PATH,TEMP_NUM)
End If
' Sets the new URL settings with correct page
QUERY_STRING = request.ServerVariables("QUERY_STRING")
theURL = "http://www." & Domain_Name & HTTP_PATH
'This section passes on the query string variables
if len(QUERY_STRING) > 0 Then
theURL = theURL & "?" & QUERY_STRING
end if
' Send 301 response and new location
Response.Clear
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", theURL
Response.Flush
Response.End
end if
%>

posted in Ecommerce, Webmastering | Comments Off

9th August 2006

Take my stupid poll, get nothing, I promise.

All righty then, you read the title, and I am ready to offer exactly what is promised. If you take my poll I will offer you exactly nothing in return. Double your money back if you are not satisfied. It’s my promise to you.

posted in Site News | 0 Comments

8th August 2006

Sitemaps expanded to include more Webmaster Tools

Google has taken great leaps forward in communicating to the webmaster how their site is viewed by google, but now is also taking feedback on how they would like it to be seen.

While there has been no evidence at all provided to show that adding a sitemap will actually help a website. They now have the option to help fix conicalization issues to set the prefered domain with or without the www (or dub-dub-dub)

posted in Matt Cutts, Webmastering | 0 Comments

1st August 2006

301 redirect

I’m testing Google’s ability to redirect by 301s. I’ve moved a blog from http://www.hvac-direct.com/blog/ to http://blog.hvac-direct.com. Testing the headers shows a propper 301 and if you click the first link it should take you without effort to the second location. This is a cross domain redirect so it may take them a while to figure it out, I’ll keep you posted.

posted in Google, Webmastering | 0 Comments

25th July 2006

Supplementals

Supplementals, Supplemental, Supplementhell.

This is googles way of telling you that they are no longer interested in keeping their search engine fresh. As a matter of fact, a significant amount of their index now is returning data from years gone by. Maybe they are rolling back time to an era when spamming was easier. Let’s give it a try, we’ll make this page really really about Supplementals. Let’s see where it ranks!

Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell. Supplementals, Supplemental, Supplementhell.

posted in Google, Webmastering | 0 Comments

18th July 2006

What should I do with this domain?

I’ve had the domain linked above for a little while and haven’t done anything with it yet. I uploaded some store software to test some asp scripting changes and that’s about it.

I could talk about boilers for days, weeks, or months. So should I:

1) Blog
2) Sell Products
3) Build a directory
4) Do all three?

I’ve often wanted to import boilers from Europe as I know their technology is far superior right now, maybe this would be a good venue for such a thing.

Any suggestions would be appreciated.

Thanks.

posted in Personal, Webmastering | 0 Comments

13th July 2006

I’m not Jennifer Love Hewitt

More information on Jennifer Love Hewitt

Huh? You say. Of course I’m not Jennifer Love Hewitt nor do I have anything to do with her, or even thought of her until a few days ago.

While perusing through the server stats I noticed an inordinate amount of traffic coming my way for the search term “JLH”. So I checked it out myself. Apparently Miss Jennifer is referred to by her fans as JLH often, actually searching for JLH brings up 1 - 10 of about 903,000 for JLH on Google. My site is the 7th on that list.

I wonder if there’s any adsense clicks for JLH out there? Or maybe I should set up sort of web store for her junk? Or maybe an eBay affiliate link?

So if you came here looking for Jennifer Love Hewitt, I don’t have much to offer other than this picture I found on google image search. Enjoy.

Jennifer Love Hewitt on JLH-Design.com

posted in Personal | 3 Comments

12th July 2006

Learning SEO & Online Marketing - Intermediate Q&A: Google Query Stats Questions - what does it mean?

Learning SEO & Online Marketing - Intermediate Q&A: Google Query Stats Questions - what does it mean?

An interview with Venessa Fox of the Google Sitemap team.


posted in GWHG, Google, Webmastering | 0 Comments

14th June 2006

Lawn Mowing Update

Well…He went and mowed around my landscaping detail. So I promptly went and mowed right up to the correct property line. This will start getting real funny if he mows again tonight when he gets home from work.

The real big news is that I’ve got a graphic to go with the saga, courtesy of Odie.

Lawn Mowing Update

posted in Personal | 2 Comments

13th June 2006

Some goofy pictures

So I promised I would post some pictures.

Here’s one of me, Ben, and Tarl, at some bar…

And another one with Tarl’s girlfriend, Tiff, giving me a kiss. She’s the one who supplied the camera as well. ..

Tiffany

posted in Personal | 2 Comments

13th June 2006

Passive-aggressive Land Grab

The older gentleman that lived next door to me moved to a nursing home last winter and sold his house. I haven’t met the couple that moved in yet, but have seen them around. They’re middle age-ish if they plan to live to 110 years old. I must admit I didn’t give them much of a chance right of the bat because the first thing they did was build a kennel for their large dog in the back yard. This poor thing is relegated to living its days out in 12 X 20 foot chain link cage.

So anyway, back to the story at hand. I live in nice neighborhood that was built in the 60’s and early 70’s. The streets aren’t straight and kind of meander around the base of the hill that the neighborhood occupies. The lots aren’t all perfectly flat or even square for that matter, mine for example is on the hill. From the street it looks like a normal 1 story ranch, but in the back yard it opens up to a 2-story walk out basement with a tons of privacy due to the old growth trees. With all of that being said, the lot lines are clearly delineated by fencing, hedges, utility poles, and off course the official demarcations.

Apparently my new neighbor isn’t quite satisfied with his lot size as he has taken to annexing some of my property through proxy by mowing more and more of my lawn. I’ve seen this before back at my parents house with a strange neighbor so I thought I’d nip it right in the bud this spring. I walked up, introduced myself, yada yada, then as I excused myself casually mentioned that if he insists on mowing my yard to have the courtesy of mowing the entire yard. This lead to a discussion, he didn’t really know the lot lines, etc, we walked around, I showed him the big telephone pole with the lead lot numbers situated right at 4 corners where all the lots came together. We then discussed how the lot line probably radiated to the streets at right angles from that point. So the spring went by….

Apparently he has rethought his position on the matter, and has again began cutting my yard. He still only goes to where the pole denotes the lot separation but now goes out to the street at an angle. I think the real problem is that my house sits back on the lot farther from the lot line than his. So when mowed properly it looks like I have more land as their is more grass next to my house than his. So began our passive aggressive battle.

I started noticing that he would make a point to mow just the stripe between our lots (but in reality on my side) then go and finish the rest of his yard, maybe go in and have drink and finish the spot by my house several hours later. So then I started timing my lawn mowing to coincide with his, as soon as I hear their mower stop, I’m out there with mine, set about 1/2″ shorter to clearly mark out my territory. So he stepped up his mowing habits. We keep this up and we’ll both be mowing daily.

So my son was up to the house for the weekend. We like to work in the yard when we can, so I thought of a project. I’ve got a landscaped area out in the front yard, kind of an island. It’s got some shrubs, rock piles, wood mulch the usual stuff. We extended the border about 3 feet so that its within 1 lawn mower width of the lot line.

Today was his first mowing since this bold move on my part, we’ll have to see how this escalates!

posted in Personal | 2 Comments

6th June 2006

Why Design?

I’ve been asked about my domain and blog name. So let’s try to tackle that.

The JLH part is no large mystery, those are my initials.

The design part is a bit more complicated. I chose that based on its the defining word for everything I have ever done, succeeded, failed, or attempted in my life. I suppose there’s also an existensial meaning behind it as well. From en.wikipedia.org/wiki/Existential, Existentialism is a philosophical movement that views the individual, the self, the individual’s experience, and the uniqueness therein as the basis for understanding the nature of human existence. The philosophy generally reflects a belief in freedom and accepts the consequences of individual actions, while acknowledging the responsibility attendant to the making of choices. It’s easy to view the scientific observances of cause and effect and believe you understand the world, but if within those details you discover the design you have truly understood the meaning.

For me design is a process, a unique one, that not all people are capable of. There is the artistic design which combines creativity with personal expression, I have little talent in this field. There is also layout design which has more to do with spatial relationships as seen in such fields as graphics design, architecture, interior design, landscaping, etc. I’m impressed with people that can do such things, but again I have no interest in this.

I must say that I have done work as a designer in the HVAC industry and in process design, mainly with heat transfer and controls.

For me the design process is used daily in work and lifelong in living. The design starts with the final product, or at least the initial notion of it. This may be a project goal, a sales goal, a marketing plan, a piece of furniture, or a business model. You have to know what you want to achieve until before you can design a way to attain those goals. I find that not having clearly defined end goal is usually the failure of most designs. Most good designers end up in the end with what they wanted from the beginning, the great designers have clearly laid out their goals before it even began. That’s the easy part.

The fun part is figuring out how you are going to attain those goals. This is the education experience, the time of discovery. When you take stock of your current assets and abilities and figure out what you don’t have and how you can get it. This is generally a time of a lot of reading, interviews, writing, and trial and error. For example when I decided I wanted to design furniture, this is the couple of years I took learning the tools of the trade, working with material, understanding the methods. When I wanted to start an online business I already knew all that there was to know with the HVAC market in which we went into, however I didn’t know a thing about HTML, shopping carts, web design, SEO, etc. I spent 6 months of research before the first page was published. Three months later we had 18,000 pages in the google index and were doing $50,000 a month in business. When an idea came up at work for a better lead/lag control system, the control theory was the easy part, for me I had to learn how to program a PLC.

The hard part is actually doing the work. The good thing is that the hard part is also usually the shortest duration of the process. If you start with well thought out design and clear directions the work can usually be delegated, any my role becomes more supervisorily in nature.

Within those brief descriptions you can see my grand plan. For me to succeed at anything I need to know it inside and out. How the sausage is made. I can’t tell a drafter how to lay out a drawing without first knowing how the drafting system works, its limitation, its possibilities. I cannot sell a product to someone without knowing how it works, how its made, or how the competition makes theirs. I need to know how its used, the processes it benefits, the applications its effective or ineffective.

I’ve got 12 domains online at the time of this writing but most are commercial in nature, this is personal. The internet is great opportunity that still exists for designers of all types. Designing a website requires a little technical knowledge, a lot of intuition, but most importantly a unique understanding on a topic.

more later.

posted in Personal, Site News | 0 Comments

3rd June 2006

Good night out

Made a great business contact last night. I’ve landed the rights to build a web site for a well established local business, its in a great sector that is kind of disorganized but has a tonnnnnn of traffic so I think I’ll be able to make it very profitable.

posted in Personal, Webmastering | 1 Comment

2nd June 2006

Met a New Friend Today

M, as she signs off has her email is all set up at the new location linked to above. It’s quite an interesting read, full of energy and spunk. Makes me think I should start writing more here…but then I’d need some time to do that.

What I learned from the whole experience is that 1) Blogger is a very buggy system, much like copy machines only breaks down when you need it the most and 2) that using an Apache server is much easier than IIS as I set up a 301 on her site in about 10 seconds, nothing to it.

What I need to figure out is how to do a proper 301 on a blogspot domain, or in the least how to set up the meta refresh to at least send you to the right page on the new domain.

Any ideas out there in blogville?

Oh well, its Friday afternoon, and I think I’m going to bug out of here and head down to the river to my favorite watering hole, Pettibone Boat Club.

posted in Personal | 1 Comment

  • Please Support

  • Marquette University

  • Sponsored

125x125

  • Donations


  • ;

Enter your email address:

Delivered by FeedBurner

rss posts
  • Latest Comments

    • Patrick Daly: Great post. Often the ease of a one-line...
    • Kimberly: You can buy primatene mist at CVS Pharma...
    • Data Entry: I know it does get exhausting, especiall...
    • pageoneresults: I do believe that person is quickly comm...
    • Everett: That's all fine until you start dealing...
    • John Honeck "JLH": g1smd, things to learn from this. 1)...
    • g1smd: Wish I had seen this earlier. :-(...
    • Data Entry: Cool - I'm going to go let them know! H...
  • Readers