http redirect loop fix