👋 Hello World

SERP correct domain 302 redirect website solution

A lot of talk in the SEO world on what to do with the problems that search engines have with the same site (page) having listed multiple url versions in the SERPS. For example:

  • https://yvoschaap.com
  • https://yvoschaap.com
  • https://yvoschaap.com/index.php

Could all be viewed as different pages by search engines, while it’s not. This resulted for some sites in a “duplicate content” penalty. I advise you guys to read more about this here or here.

My general solution to this is this simple and small piece of PHP. So NO htaccess stuff, or manual redirecting, etc.

$domain = "www.yvoschaap.com";
if($_SERVER['HTTP_HOST'] != $domain || preg_match("#index.php#i",$_SERVER['HTTP_HOST'])){
  header("HTTP/1.1 301 Moved Permanently");
  header("Location: http://".$domain.$_SERVER['REQUEST_URI']);

It says this: if host isn’t the “www” version OR if it is the /index.php version. Show an official “moved” page, with the right location: https://yvoschaap.com/
Just put it in the top of your index.php file, et voila. No rocket science…

Posted by

Got myself some gadgets...

Today I felt like spending some money and that brought me to buy a home cinema projector (CONTRAST 5000:1, 1100 ANSI-LUMEN, HD RES) and with that an Xbox360. And WOW, thats crazy cool.

If you bring A DVD or XBOX game you can come and watch or play on my new 3 meter screen.

And Microsoft did a great job on the Xbox. I don’t have games yet, and was hoping for build-in WiFi, but having the Xbox (with the full screen HD projector) control your media files on your computer works! And easy! No weird settings, all plug-and-play, and within a minute I am listening to some album on my PC, through the local network, via the Xbox to my stereo, controlled on the toilet remotely. Take that…

Update: Okay, I have to get back on the Xbox… somehow it has some big ass glitches: sync (video: audio) with playing DVDs is almost always wrong! Xbox live? It has never really worked with need for speed. It has no good connection, and it freezes up. And last but not least, when playing a DVD in HDTV format you get some weird stripes throughout every movie you try to play.

Posted by

CSS: Star Rater Ajax Version

So, I found this great star rater script made in css. But I missed the web 2.0 stuff. So I played around with it to make it work on a database without having to refresh any pages (but updating the database with AJAX). In this version I use it for rating a image (with unique ID = imgId).

not a beginners tutorial - and just follow the steps

1) The star image:

Star rate image (use save as..)

2) Javascript part (to do the dynamic stuff):

Javascript with AJAX module + rateImg function. (use save as..)

3) PHP part: Create a update.php file (to do the database update with the user rating):

if($_GET[‘rating’] && $_GET[‘imgId’]){
$dbh=mysql_connect ("localhost", "#######", ""#######", ") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db (""#######", ");
$imgId = $_GET['imgId']; //clean up variable from exploits (e.g. via is_numeric(), or addslashes())

//adds the rating to imgID in the database
$update = "update vote set voteNr = voteNr + 1, voteValue = voteValue + ".$_GET['rating']." WHERE imgId = '".$imgId."'";
$result = mysql_query($update);
if(mysql_affected_rows() == 0){
//creates a new row if imgID has no own row yet
$insert = "insert into vote (voteNr,voteValue,imgId) values ('1','".$_GET['rating']."','$imgId')";
$result = mysql_query($insert);
//Assume OK, return some text . current rating?
//OK return some text / current rating?

4) Mysql part: (to create a table).

        `voteNr` int(8) NOT NULL default ‘0’,
        `voteValue` int(8) NOT NULL default ‘0’,
        `imgId` varchar(100) NOT NULL default ‘’,
        UNIQUE KEY `imgId` (`imgId`)

5) CSS part
Stylesheet part (creates onmouseover stars):

Stylesheet to create stars + mouseover. (use save as..)

An example php code to retrieve the current rating from the database: $rating = getCurrenRating(‘12’);

function getCurrenRating($imgId){

$sql= "select * from tblVote WHERE imgId= '".addslashes($imgId)."' LIMIT 0, 1";

return @round($rs[voteValue] / $rs[voteNr],1);


$rating is the rounded rating taken from database.

$imgId is the unique id for this (image) item. This is used in the javascript, passed to the update.php file to update the database.

And don’t forget to include the rating.js file.

<div id="rating">
<ul class=‘star-rating’>
<li class=‘current-rating’ id=‘current-rating’ style=‘width: <? $ratingpx = $rating *25; echo $ratingpx;?>px’><!—Currently <? echo $rating ?>/5 Stars.—></li>
<li><a href="javascript:rateImg(1,’<? echo $imgId ?>’)" title=‘1 star out of 5’ class=‘one-star’>1</a></li>
<li><a href="javascript:rateImg(2,’<? echo $imgId ?>’)" title=‘2 stars out of 5’ class=‘two-stars’>2</a></li>
<li><a href="javascript:rateImg(3,’<? echo $imgId ?>’)" title=‘3 stars out of 5’ class=‘three-stars’>3</a></li>
<li><a href="javascript:rateImg(4,’<? echo $imgId ?>’)" title=‘4 stars out of 5’ class=‘four-stars’>4</a></li>
<li><a href="javascript:rateImg(5,’<? echo $imgId ?>’)" title=‘5 stars out of 5’ class=‘five-stars’>5</a></li>

Completely confused? See example here (scroll down) http://www.guidetobuy.info/product6-beamers.html.

NEW: Simple inline text edit!

Posted by

Mercedes cls

Would be a nice goal to set in 2006: mercedes cls (55amg), together with no more smoking.
Wow: fast, classy, expensive, comfortable, and very beautiful.

Posted by


Some final year stats after this - more or less - successful year. Over 17,000,000 ads were shown (yes, those are 6 zeros) resulting in around a x digit income. Kiesjestudie.nl was launched, and shows some nice growth, and more important, good feedback (with some criticism) about the site. Knowing that the head of the ministry of education knows about your site is also a fun fact. On the subject check their project out: http://www.studiekeuze123.nl/. Semi-competition is always good.

Seeing people involved and using your developed product is nice. And it is one of my top projects. Perfect in SEO, function, and content. Working on something like Institution Location made me a master in javascript, geolocating, and a more then frequent visitor of the google api help guide.

Next year I’ll have to see what to do. I will be looking for nice projects to develop (full projects from AJAX, CSS to SEO and marketing). Some contacts have already been made. My thoughts are on non-commercial projects. To do something back to the ‘world’. In a quick brainstorm it would be something like a platform where people who have voluntary projects to advertise/market it to a bigger audience through this platform. (creating global/local awareness about something we don’t see daily).

So on to 2006, let it be good for all. I’ll be spending some of the ‘click-money’ in the mountains of Swiss next week.

For the record, I also managed to get some ECTS in univeristy.

Wow, I should learn how to write. This is painful for the brains to read

Posted by

1 2 3 4 5