- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello:
I am testing a CGI program using C language and Shell under the Nios2 Linux system. What I want is to implement the "Redirection" function to redirect user's browser to a website: for exmaple "www.google.com". My approach is to print the "Location: URL" header to user's browser. What I did is like this, I wrote a C program that is doing simple I/O access,and contains the last line: printf("Location: http://www.google.com\n\n"); (http://www.google.com\n\n"%3b%29;) I also wrote a shell scirpt which was: # !/bin/sh echo "Location: http://www.google.com" (http://www.google.com") echo "" Finally,I put them into the proper place and tried to link them using IE. Both execution turned out successful(I/O result was correct),but they did't bring me to google! After the execution,both of them only took me to the previous folder. (i.e. from http://192.168.1.1/cgi-bin/test.cgi (http://192.168.1.1/cgi-bin/test.cgi) to http://192.168.1.1/cgi-bin/ (http://192.168.1.1/cgi-bin/) ) Can anyone please tell me what's the problem!? Thank you so much. Best Regards.Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I presume that you're using boa?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello clansdown:
Yes,I am using boa.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Two other questions:
(1) What happens if you go to it manually, e.g.telnet host 80
GET /cgi-bin/test.cgi HTTP/1.1
Host: hostname
(2) What happens if you use some other browser, such as Firefox?
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page