I want to use the skeleton of pset7 for my final project, however I can't get the index to redirect to any other page. I get this phpinfo() page, and when I try to put code in index.php to redirect the user to another page, nothing happens.

I edited /etc/hosts and added app for lack of a better name. When I put http://app into chrome, I get the phpinfo() page.

The browser always requests index.php by default. This requires ../includes/config.php, which defines redirect(). I then call redirect("../public/foo.html"), which should bring me to that page, but it doesn't. Any code I put in index.php seems not to be running. Why is this?

How can I fix this?

  • You put these in a folder in vhosts, right? Does it make a difference if you use absolute paths instead of the relative paths you have above?
    – ronga
    Commented Dec 12, 2015 at 4:59

1 Answer 1


It turns out I needed to put the files inside the vhosts folder. Index.php was not found when it was outside this folder.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .