h1

asp 301 seo redirect upper / lower case

April 25th, 2007

I posting on forums and blog how seo = 301 …

So last few day i’ve spotted some dup content issues which i’ve been fixing with a new 301 script that check the case of a query making sure that only the 1 case is ever indexed..

What goes wrong:

page.asp?case=HELLO

vs

page.asp?case=hello

 

Both the above would return the same page..

 

thesku=Request.ServerVariables(”QUERY_STRING”)
nothesku=Left(Right(thesku, Len(thesku)-5),1)

thesku=Left(Right(thesku, Len(thesku)-4),1000)

nothesku=(ASC(nothesku))

if (nothesku>96)then
thesku=UCase(thesku)

‘you can change the below to whatever you page name is.. 

thesku=”page.asp?case=”&thesku

Response.Write(”change to uppercase”)

end if

Response.Write(thesku)

 

The above checks the Ascii value for the first char and if lower will write out the page location in upper case.. By adding a simple 301 redirect to this its will pass the value to the correct no dup page..

 

Problems and bugs with the above..

It only check the first letter.. now for me this is fine but you can of course loop and check each letter..

 

Leave a Comment

You must be logged in to post a comment.