trim redirect keyword before checking