473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

HttpWebRequest returning 404 when page exists

I'm getting a 404 error when I shouldn't, the page exists

the error is
The remote server returned an error: (404) Not Found.

the status is 7 witch equates to WebExceptionStatus.ProtocolError

I have the same web site on my production server but when loaded on my live
server it errors.

both servers are the same setup as far as I can remember I have nothing
different

win 2003 web server behind a win 2000 sbs server with ISA 2000

pages is on same site in same directory, code is below and url is correct.

any ideas


Dim sn As String = Request.ServerVariables("SERVER_NAME")

Dim wr As WebResponse = HttpWebRequest.Create("http://" & sn &
"/contact/email.aspx").GetResponse
Dim sr As StreamReader = New StreamReader(wr.GetResponseStream())

Dim replyBody As String = sr.ReadToEnd

Aug 20 '08 #1
1 2457
Like so many times as soon as I post my problem the solution comes to me.

In my case it is because I have a second domain name pointing to the server
and using the server variable to get the server name gets a domain name that
is not included in the internal dns so it does not resole internally.

"ThatsIT.net.au" <me@workwrote in message
news:88**********************************@microsof t.com...
I'm getting a 404 error when I shouldn't, the page exists

the error is
The remote server returned an error: (404) Not Found.

the status is 7 witch equates to WebExceptionStatus.ProtocolError

I have the same web site on my production server but when loaded on my
live server it errors.

both servers are the same setup as far as I can remember I have nothing
different

win 2003 web server behind a win 2000 sbs server with ISA 2000

pages is on same site in same directory, code is below and url is correct.

any ideas


Dim sn As String = Request.ServerVariables("SERVER_NAME")

Dim wr As WebResponse = HttpWebRequest.Create("http://" & sn &
"/contact/email.aspx").GetResponse
Dim sr As StreamReader = New StreamReader(wr.GetResponseStream())

Dim replyBody As String = sr.ReadToEnd
Aug 20 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ATS | last post by:
PRB - HttpWebRequest does not work with CGI websites and/or RAW data Please help, I'm trying to make a web deploying UserControl that gets RAW binary data that is dynamically created from a...
3
by: Hardik Shah | last post by:
Hi, I am calling an ASP.Net page from an ASP classic application but need the .Net page to have access to ASP classic's session variables. I am using HTTPWebRequest to call ASP classic page...
2
by: Toralf | last post by:
Greetings I have trouble catching the actual HTML Source code of a HttpWebRequest when the result of a successful login is a Frameset (I cant seem to get hold of the Frameset page Source code)....
2
by: Michael | last post by:
Hi all.. I need to submit an asynchronous request for a credit card authorization. I have an aspx page where the user confirms the transaction and clicks a button to send the transaction to the...
0
by: Susan Van Houen | last post by:
Hi Everybody, I have a problem that is driving me crazy and I am hoping for some help here. I am building an application (vb.net, vs2003) that crawls selected websites. The application works...
10
by: rlueneberg | last post by:
I am trying to foward the old sessionID using "Session.SessionID" to an HttpWebRequest CookieContainer so that I can capture the requested page session variables but it is not working as it is...
2
by: wajih.boukaram | last post by:
Hi I've been using asp.net for a couple of days now and i think I've gotten the hang of things I do have a problem when using HttpWebRequest: i request a page from a remote server and this...
12
by: Mark Rae | last post by:
Hi, The following code works: HttpWebRequest objRequest = null; try { HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create("http://www.microsoft.com"); using (HttpWebResponse...
1
by: ThatsIT.net.au | last post by:
I'm getting a 404 error when I shouldn't, the page exists the error is The remote server returned an error: (404) Not Found. the status is 7 witch equates to WebExceptionStatus.ProtocolError ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.