Just for fun, I've been experimenting with URL redirection using the "Location" header sent before html.
Below is my Arduino code that makes the web page I am serving at
http://thatsgoodbob.dyndns.org:8248/
The page redirects, as expected, to
http://google.com when viewed in Firefox or Chrome.
BUT ... if I try to view the page in IE 8 or IE 9, no redirection happens, and the page in the code below appears.
I know this is not really an Arduino issue, but all of the answers I've found on the web have to do with PHP, which is not the issue here.
Does anything see anything in my code that explains what is happening ?
Thank you for helping me.
Bob W (code follows . . )
client.println("HTTP/1.1 301 Moved Permanently");
client.println("Location: http://google.com");
client.println("Content-Type: text/html; charset=iso-8859-1");
client.println("Connection: close");
client.println();
client.println("<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">");
client.println("<html>");
client.println("<body>");
client.println("<h2>You should not be seeing this page . . .");
client.println("</h2>");
client.println("<br>");
client.println("Because \"Location: http://google.com\" is in the header before the html.<br><br>");
client.println("It redirects as expected in FF and Chrome.<br><br>");
client.println("But this page displays in IE 8, 9<br><br>");
client.println("What am I doing wrong ? <br><br>");
client.println("</body>");
client.println("</html>");
client.stop();