Can't Find PHP File After Switching Ports!!!!

September 3, 2018 332 views
Apache Ubuntu 16.04

I am using this tutorial: https://www.digitalocean.com/community/tutorials/how-to-create-temporary-and-permanent-redirects-with-apache. Everything goes well until Step Five. I am able to load my example.com:8080 website, but when I try to load the PHP document (example.com:8080/info.php), I can’t find it! I only lost track of it once I switched my ports and what not, but I tried creating a new PHP document and I sitll can not find it!. Does anyone know how I can fix this? It says my requested URL was not found.

1 Answer

Hey friend!

It will be difficult to know the solution to this externally. The best way to go about it is to break down what is happening and why. If /info.php gives a 404 error, then the web server is not looking for it in the place that you think it should be. Follow your path in the configuration. What virtual host is set to point to what document root, and does that document root contain the file? Are you redirecting to another virtual host that then points to another document root that does not contain the file? Is the web server you are editing the configuration of actually listening on the relevant port?

It is a logic issue, and the specifics of that logic are doing to be very situational. Review your logic a few times and you may see an error in it.

Jarland

  • It’s hard to describe how I went wrong, but the issue was because of me. I have fixed it. Thank you for your advice. Sometimes you just gotta start from square one and re-look over stuff.

Have another answer? Share your knowledge.