473,378 Members | 1,607 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,378 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 1298
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 ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.