473,403 Members | 2,366 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,403 software developers and data experts.

redirect using addheader not working

Hi I'm trying to use this bit of code that I found in a few places to redirect the page to a 404.html page...

Response.Status="404 Not Found"
Response.AddHeader "Location","http://sitename/404.html"

It doesn't seem to work but just returns an error. As far as the header is concerned it gives us exactly what we want but just doesn't do the redirect...

Using the same bit of code but with a 301 Permanently Moved does do the redirect but doesn't give us the proper header...


Response.Status="301 Permanently Moved"
Response.AddHeader "Location","http://sitename/404.html"


If I use the response.redirect method anywhere in the page the Status becomes a 302 automatically, hence the reason we are trying to use this code in the top example...

Can anyone help with this?
Mar 22 '11 #1
0 1535

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ravindra | last post by:
Hi, Im trying to use Response.Redirect in Session_End event in Global.asax page, which is not working. Why this is not working? And if this not works here, how do I hanlde this? Any possible and...
4
by: Greg Scharlemann | last post by:
I thought I had a workable approach to specifing which pages required a redirect in a config file, but it appears the way I'm attempting to do it is not going to work. The idea is that I can...
0
by: Sameer Deshpande | last post by:
Hi, I am using python SOAPpy module to call a web service. Call to web service gets executed successfully. I am facing a problem if the call to WS results into redirect. I get "HTTPError:...
14
by: gaurav tyagi | last post by:
in my appplication if i try to go to next page using response.redirect, it does not work and control remains on same page but if i use server.transfer control goes to nex page?? can any one...
4
by: davidfahy | last post by:
Hi all How can I transfer user to another server using POST. The problem is that Server.Transfer (preserves form data) works just in current server. Response.Redirect - uses GET method. However...
1
by: Samuel Shulman | last post by:
Hi I am looking for a way to send a POST request using the Reponse.Redirect or any thing similar Thank you, Samuel
5
by: Samuel Shulman | last post by:
Hi I would like to redirect say from http://mysite.co.uk to http://www.mysite.co.uk but because my home page is html I have to use JS Thank you, Samuel
2
by: mitDAS | last post by:
I have problems with redirecting in Mono. Nor Server.Transfer, nor Response.Redirect have working. I have not ANY problems under Windows XP. I am using C#. Please help!
2
by: kathirgee | last post by:
I Used the following code for redirect header('Location: filename.php'); but i get error msg like this Warning: Cannot modify header information - headers already sent by (output started at...
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?
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...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.