0

I'm trying to view a localhost website on my iPhone for testing but I've ran into some trouble. I can get to /localhost/ in my phones browsers fine, without issues. However when I go into a project folder (ie. /localhost/project/) it simply returns a "Safari cannot display the web page" error.

This answer helped me so far to get to the localhost folder but going any further doesn't work. I changed the httpd-conf file to use a port other than 80 but that didn't work for me.

I've tried the following with no luck:

  • 0.0.0.0/project/
  • 0.0.0.0:80/project/
  • 0.0.0.0:80/project

I even tried the following which took me to a Bad Request (400) error page presumably part of the application in the project folder although it was a standard white page error document (not a custom error document page).

  • 0.0.0.0:443/project/
Community
  • 1
  • 1
Dan
  • 1
  • 2
  • You should try to add an actionable question to your post to help others help you, such as "What is the correct way to blah blah blah?" – diatrevolo Mar 19 '15 at 17:00

1 Answers1

0

I managed to figure this out and it's down to iOS not responding well to non-domains in Safari's address bar. The issue was that the application in my project folder had a site url defined which was set to localhost/project/.

What stumped me to begin with was that when I went to my IP address (x.x.x.x), it worked fine, but when I went to a project folder (x.x.x.x/project/) is looped back because iOS doesn't accept localhost as a proper destination address (hence the loop), so changing the site url in my applications database to my IP address instead meant that it always stayed on a valid address and it now works.

Presumably the reason why the iPhone didn't like 'localhost' is that it's a term defined by XAMPP, a location used by the program; obviously not on the iPhone. Easy fix!

Dan
  • 1
  • 2