I am trying to get a web page from my homepage hosted by 1and1.co.uk. I have used the standard Ethernet client sketch and it works OK with Google, but when I change the details for my own home page, I get the following returned:
HTTP/1.1 301 Moved Permanently
Date: Wed, 28 Dec 2011 20:06:14 GMT
Server: Apache
Location: http://www.thehouseofwicks.co.uk/Index.html
Content-Length: 251
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.thehouseofwicks.co.uk/Index.html">here</a>.</p>
</body></html>
I know that the page exists as I can see it via IE etc. Perplexed! I think it is something to do with 1and1 (as I say the code appears to work for Google). Has anybody else had this issue? Am I overlooking something obvious? Is it even possible with 1and1?
I have used the following sketch (part only shown):
char serverName[] = "www.thehouseofwicks.co.uk";
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;
void setup() {
// start the serial library:
Serial.begin(9600);
// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// no point in carrying on, so do nothing forevermore:
while(true);
}
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.println("connecting...");
// if you get a connection, report back via serial:
if (client.connect(serverName, 80)) {
Serial.println("connected");
// Make a HTTP request:
client.println("GET http://www.thehouseofwicks.co.uk/index.html HTTP/1.1");
client.println("Host: www.thehouseofwicks.co.uk");
client.println();
}
}
Thanks!