0

I'm trying to redirect my domain http://www.domain.com to other domain with ssl https://www.domain2.com

I use this code in the index.php:

<?php header("Location: https://www.domain2.com"); ?>

And I get this error: "This web page has a redirect loop". What can be the problem ?. I also try redirecting to javascript.

Thanks.

wanheda
  • 81
  • 1
  • 9
  • Yes, that's an infinite loop. You should only redirect if it's not HTTPS. Put an `IF` statement in. – Marcus Adams Jan 22 '15 at 14:14
  • possible duplicate of [How can I force users to access my page over HTTPS instead of HTTP?](http://stackoverflow.com/questions/85816/how-can-i-force-users-to-access-my-page-over-https-instead-of-http) – Marcus Adams Jan 22 '15 at 14:14

1 Answers1

-1

Clearing your cookies is another prudent action.

luis
  • 1