Archive for the '301 for seo' Category

h1

asp 301 seo redirect upper / lower case

Wednesday, 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..

 

h1

php redirect.. Make sure you only have the one homepage!

Friday, August 25th, 2006

This is the first post in this section but trust me this is going to be a massive section covering php/asp .htaccess vbulleltin phpbb and bespoke redirecting - 301 for SEO..

 So i’m starting off with some simple php that redirects the index.php to / of the main domain.. This then stops the like of google, yahoo and msn indexing www.seohome.co.uk and www.seohome.co.uk/index.php

So at the very top of the page your need to add the following php

$site_base_url ‘http://www.seohome.co.uk’;
function 
assertProperURL($site_base_url$proper_url)
{
$request_uri $_SERVER[‘REQUEST_URI’];
$current_url $site_base_url $request_uri;
if (
$current_url != $proper_url) {
header(“HTTP/1.1 301 Moved Permanently”); 
header(‘Location: ’ $proper_url);
}
}
assertProperURL($site_base_url$site_base_url ‘/’true);
 

note: you have to make sure that this is only on the index.php file and not on any other file.. If you added this script to another file then it would redirect to the top domain…