Re: buffering to allow headers in code? [message #170195 is a reply to message #170180] |
Sun, 17 October 2010 17:39 |
Thomas 'PointedEars'
Messages: 701 Registered: October 2010
Karma:
|
Senior Member |
|
|
MikeB wrote:
> Michael Fesser wrote:
> So this would be correct:
>> header('Location: http://localhost/recipes/');
>>
>> Of course this will be bound to your own local machine, which is not
>> good. To make it more flexible, replace the 'localhost' part with
>> $_SERVER['HTTP_HOST']. There are even more examples in the PHP manual.
>> Just see the page for the header() function for more details.
>
> OK, I can see how to construct that URL (or is it s URI?) from the
URLs can be understood as a subset of URIs (see the RFC).
> variables I have. This is all fine and dandy if I want to redirect to
> the root page for a website, but what if I want to redirect to something
> other than the index.php (or index.html) page that sits at the top of
> the website?
RTFM. The DirectoryIndex directive value is being inherited from parent
directories (or the server configuration) and can be overwritten (if the
required privileges are provided).
BTW, none of this has anything to do with PHP besides using the header()
function.
> Or are you saying that all redirect must always redirect to the top page
> of a website?
Certainly not.
> I'm sorry if I'm obtuse. I'm not trying to be, I'm just unfamiliar with
> what is "right."
>
> And then I get distracted by pointy ears and spend a lot of time on
> stuff that does not help. :(
For someone trying to not be obtuse, you are rather quick at jumping to
conclusions and pointing fingers at people when the problem is with *you*
(either failing to explain your use-case or understanding the suggested
solutions). Please change your attitude or go away.
Score adjusted
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
|
|
|