Trying to fix 404 redirect loop