Castling rule clarification A quote from Wikipedia for castling rule:


  the squares between the king and the rook involved are unoccupied


What if the squares are not occupied at this instance but an opponent piece was there before?  

I tried on a computer chess game, it would not allow a castling move.
FIDE Article 3.8:


  (1) The right to castle has been lost:
  
  
  if the king has already moved, or
  with a rook that has already moved.
  
  
  (2) Castling is prevented temporarily: 
  
  
  if the square on which the king stands, or the square which it must
  cross, or the square which it is to occupy, is attacked by one or more
  of the opponent's pieces, or
  if there is any piece between the king and the rook with which
  castling is to be effected.
  


The fact that a enemy piece previously occupied a square between the king and rook does not make castling illegal. Instead, there is probably some other reason why castling is not permitted.