473,404 Members | 2,187 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,404 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 2236
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

10
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.