If you can get to your web server via IP address but not by hostname that means that you do not have DNS configured. DNS is designed to translate between so-called "friendly names" and IP addresses via a DNS server.
You can't edit the /etc/hosts file on iOS without jailbreaking your iPhone.
What you need to do is be able to manually configure your router (assuming you have a common home router provided by your ISP) to point local addresses to specific local host names. Unfortunately most home routers don't let you modify DNS settings, instead they pass DNS through to the ISP's DNS servers or use a public DNS server.
So what you would need to do is set up a DNS server on your local network to point local IP addresses to specific host names and then set up your iPhone to use that DNS server in Settings > WiFi > [your Wifi network] > Configure DNS > Manual.
But honestly that is a lot of trouble, I'd just use the IP address.