0

I would like to redirect a page. Originally I used the header command in order to redirect. But sometime ago I found that it does not work. What is another conmnand in order to redirect a page? I developed it by using the PHP language.

2
  • 4
    It would be better to ask why it's not working sometimes (because it should be) and post your code. header() is the best way of redirecting a browser to another page. Commented Aug 24, 2010 at 9:57
  • What do you mean 'does not work'? It throws an error message or simply doesn't doing anything. I think a command must work at anytime. (or at least should throw an error message). Commented Aug 24, 2010 at 9:59

1 Answer 1

7

Would you buy a new car when your old one runs out of gas? I doubt so.
When you find that something doesn't work, you have to repair it, not start looking for something else.
Especially if you're doing right way at the moment. HTTP header Location: is the only reliable and standard way to do a redirect.

There is always an error message, to tell you what's going wrong.
You have to just read this message. If it isn't going to screen, most likely it can be found in the error_log

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.