The rules are more complex. I'd say just do away with the refer(r)er.
http://webmasters.stackexchange.com/questions/47405/how-can-...
Maybe later when you have a real problem, fix it then. Let's cross bridges when we come to the river, that way we'll all have much simpler code!