Click here to Skip to main content
14,773,218 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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


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


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()


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
Posted
Updated 14-Jan-14 3:51am
v2
Comments
CHill60 14-Jan-14 9:48am
   
is contact.html in the root folder? I'm not sure about teh "/." bit ... shouldn't that be "./*" to indicate the same folder as the current location?
SREENATH GANGA 14-Jan-14 10:09am
   
I changed It and tried but still the issue is continuing
CHill60 14-Jan-14 10:11am
   
Is contact.html in the same folder as the main page?
SREENATH GANGA 14-Jan-14 10:51am
   
yes its in the same folder and when I view it from local machine(development machine its working fine means page is navigates

1 solution

I changed the App file upload part from

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

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


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



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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900