OnEnterTrigger wont work

I have a moving game object with rigidbody and box collider. I have set up another box collider in the way of its path and want to make the moving object rotate 90 degrees when it goes through the box collider.
despite many attempts nothing works I have also tried using OnCollisionEnter . this is my code.

using UnityEngine;
using System.Collections;

public class tilts : MonoBehaviour {

void OnTriggerEnter (Collider collision)
{
	if(collision.gameObject.tag == "boxc")
	{
		
		transform.Rotate (0, 0, 90);
}

}
}

try to test it using Debug.Log first to see if it really went inside ontriggerenter. you should always use debug.log/print to check if you went inside a specific method.

Make sure that the object with the other collider also has a rigidbody (set it as kinematic if needed).