473,408 Members | 1,735 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,408 software developers and data experts.

how does one send a "302 redirect" http header?

Not especially a PHP question, but how does one indicate a 302
redirect? Or does Apache do that automatically if I use PHP to send a
location header?

On Accumulist, if you click a title, you go first to Accumulist again,
and then you are redirected to whatever article you might want to read:
http://www.accumulist.com/
Does Apache send a redirect code? Or do I have to?

Apr 15 '06 #1
2 4536
lawrence k:
Not especially a PHP question, but how does one indicate a 302
redirect? Or does Apache do that automatically if I use PHP to send a
location header?


header('Location: ... ') causes Apache to send a 302 unless you have
already sent another 3xx response (e.g., header('HTTP/1.1 301 ... ')).
It's documented at

http://www.php.net/manual/en/function.header.php

--
Jock

Apr 15 '06 #2
lawrence k wrote:
Not especially a PHP question, but how does one indicate a 302
redirect? Or does Apache do that automatically if I use PHP to send a
location header?


No, when you use PHP to send a location header you are doing that, however
the default behaviour in PHP is to do exactly what you suggest - i.e. send
a 302 header - this is most likely WRONG, and really you should be sending
a 301,303 or 307 depending on the context. RTFM.

C.

Apr 15 '06 #3

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

Similar topics

4
by: dalyjason | last post by:
Okay, here's my question. <% dim idnum idnum=request.querystring("id") Response.Buffer = true Response.Redirect "uploadpic.php?idw=" & idnum
1
by: anna | last post by:
I am trying to redirect to a page to open word/excel document. The trick is that I don't know the path. I have a grid where the user selects the document to open, and based on that selection, the...
4
by: dlsan | last post by:
Hello to everybody. I'm working in Italy on this website http://www.fondazioneantonioruberti.it/ariene/ as css/xhtml/graphic designer in cooperation with a php programmer and a ISP provider....
4
by: PhillipBD | last post by:
Quick question. What does the URL "/" argument do in the Response.Redirect method?
5
by: Tmuld | last post by:
Hello, How do I return to a page using response.redirect - keeping the state value? Right now I have a back button - on pressing it - it send the user back to WebForm1.aspx - but all the...
2
by: Me | last post by:
I am passing on the input name to my asp page using Response.redirect "mypage.asp?name=" & name and the resulting url looks like 'companyname/mypage.asp?name=" & name I would like it to appear...
1
by: jhmace | last post by:
I have embedded a script into a simple page that allows a visitor to join an email list. The email list is hosted by campaigner.com. The site is: http://www.GreenFinds.com The email signup is...
7
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am trying to set this up using asp code and IIS configuration. But it seems not working. Here it is the way I am doing. In IIS I set up a virtual directory with secure communication, I...
1
by: Boaz Liebes | last post by:
Sometimes the result of this statment is to redirect me to filename.aspx without the anchore How Can I Get to this InsideAnchor?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.