只需要这样既可:printf("Location: http://www.baidu.com\n\n");不需要在写html的meta头了(即,printf("%s\r\n\r\n","Content-Type:text/html"));