Page Redirect

I totally forgot how to redirect to another page using PHP. After trying to remember I had to look it up in the PHP documentation. So if you want to redirect to another page using PHP you write to the header using this bit of code:

header('Location: index.html');

I opted to use PHP solution instead of the HTML meta refresh tag. You can do the same thing by placing this tag in your html output.

<meta
  http-equiv='refresh'
  content='0;URL=http://www.juixe.com'>

Of course, you can redirect to another page in just about in every language, including JavaScript as this snippet of JavaScript code demonstrates it:

document.location.href='index.html'

Related posts:

  1. htaccess to Redirect WordPress Blog To Another Domain
  2. TechKnow Year In Review 2005
  3. Search Engine Optimization
  4. Google Web Toolkit Tutorial: The Break Down
  5. Ruby On Rails Controller Path
  6. HTML FieldSet Tag


Leave a Reply