请求网址未找到 [英] Request url not found

查看:93
本文介绍了请求网址未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的一位朋友创建了一个网站,并且需要在我们上传它之前向他展示所以我把它放在了它的主页中



正在上传是成功的但是当点击任何链接时我们收到一条消息

I had made a website for one of my friend and need to show him before we upload it so I put it in the hosted it in the appengine

Uploading was successful but when any link is clicked there we recieves a message

Error: Not Found

    The requested URL /contact.html was not found on this server





我的app.yaml是



my app.yaml is

application: alshafarnew
   version: 1
   runtime: python
   api_version: 1

   handlers:
   - url: /(.*\.(gif|png|jpg|ico|js|css|swf|xml))
     static_files: \1
     upload: (.*\.(gif|png|jpg|ico|js|css|swf|xml))

   - url: /(.*\.html)
     static_files: \1
     upload: index.html

   - url: /.*
     script: main.py

<来自google.ap的


和main.py是





and main.py is

from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app

class IndexHandler(webapp.RequestHandler):
    def get(self):
        if self.request.url.endswith('/'):
            path = '%sindex.html'%self.request.url

        self.redirect(path)

    def post(self):
        self.get()

application = webapp.WSGIApplication([('/.*', IndexHandler)], debug=True)

def main():
    run_wsgi_app(application)

if __name__ == "__main__":
    main()





但我检查了仪表板,发现html文件已经存在



我知道它的一些小问题或错误,因为我是网站部署和设计的新手

任何人都可以提出可能的错误。我已经通过许多网站寻求解决方案



我的页面是

http://www.alshafarconstruction.appspot.com/inde x.html



but I checked the dashboard and find that the html files are already there

I know its some small issue or mistake from my part as I am new in websites deployment and designing
can anyone suggest possible errors .I had already gone through many sites for the solution

my page is
http://www.alshafarconstruction.appspot.com/index.html

推荐答案

我更改了应用程序文件上传部分



I changed the App file upload part from

- url: /(.*\.html)
    static_files: \1
    upload: index.html



to


to

- url: /(.*\.html)
  static_files: \1
  upload: .*\.html





现在我的App文件就像是





Now my App file is like

application: alshafarconstruction
version: 1
runtime: python
api_version: 1

handlers:
- url: /(.*\.(gif|png|jpg|ico|js|css|swf|xml))
  static_files: \1
  upload: (.*\.(gif|png|jpg|ico|js|css|swf|xml))

- url: /(.*\.html)
  static_files: \1
  upload: .*\.html

- url: /.*
  script: main.py







确保上传所有html文件(恭喜) sy:给在另一个社区帮助过我的朋友)




which make sure all the html files are uploaded ( courtesy : to the friend who helped me in another community)


这篇关于请求网址未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆