making redirect work for both dev and prod environments