Failed to load webpage with error: The requested URL was not found on this server

∥☆過路亽.° 提交于 2020-01-14 09:52:08

问题


I'm experiencing a weird error with my PhoneGap app: every odd time I run the simulator (or the test deployed app on my phone), I get the error

Failed to load webpage with error: The requested URL was not found on this server.

It works every even time I run the simulator. This has been happening since I first deployed my app. I was not using any plugins at the time, but since then I've been trying to get the Facebook iOS SDK working, and this probably isn't related but the times that my app actually succeeds to start up, I can't click anything.

God help me.

This is my first time building an iOS app, so this is probably a newbie mistake - before this my app was just a mobile website.


回答1:


I just experienced this issue. The Urls are case sensitive. So if you have Login.html as the file name, it shouldn't be login.html in the code.




回答2:


It was a javascript redirect that was causing this. Avoid using window.location = ??? on the initial pageload at all costs in PhoneGap :)




回答3:


kill -9 ps ax | grep Simulator | grep -v grep | awk '{print $1}'

Try this line on the terminal and then run. Maybe there is a problem in simulator, it will resolve




回答4:


I had the same issue. However, it was a different cause.

We have a webapp that uses clean urls. We use htaccess to automatically check for .html. That way our links in the code/url are just myapp.com/page1 vs myapp.com/page1.html

This caused me about an hour of headaches, as I began exploring the port over to phonegap. Nothing would work. I was brand new to phonegap, so I wasn't sure what it was. I did the whitelist, external hosts, etc. Then I realized I dont have the htaccess file in the phonegap directory and that I need complete links.

I know its specific. But for what its worth, there you have it.



来源:https://stackoverflow.com/questions/12885267/failed-to-load-webpage-with-error-the-requested-url-was-not-found-on-this-serve

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!