title: flask route variables 404 not found
body: <p>I have been trying to get a simple web api to run on my shared hosting environment through 1and1.</p>
  
  <p>I have setup this path ~/myapp/api where i put all my python scripts.
  This is the one I can't get to work (test.py):</p>
  
  <p>the problem is with the last route. It will only work if I create the directory "tables." otherwise it throws a not found error. </p>
  
  <pre><code>from flask import Flask
  app = Flask(__name__) 
  
  @app.route('/myapp/')
  def api_base():
    return "/myapp"
  
  @app.route('/myapp/api/')
  def api_base_full():
    return "/myapp/api"
  
  @app.route('/myapp/api/table/', methods = ['GET', 'POST'])
  def api_routes_table():
      if request.method == 'GET':
          return getAllTableItems()
      elif request.method == 'POST':
          return insertNewTableItem()
  </code></pre>
  
  <p>.htaccess in ~ directory:</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^myapp/(.*)$ /myapp/api/cgitester.py/betabank/$1 [L]
  </code></pre>
  
  <p>cgiteseter.py:</p>
  
  <pre><code>from wsgiref.handlers import CGIHandler
  from test import app
  
  CGIHandler().run(app)
  </code></pre>
  
  <p>I have a feeling the problem is with my .htaccess file cause I don't really know what i'm doing in there. I can't figure out how to fix this looking at flask documentation and stackoverflow posts. thanks for any help</p>
  
  <p>what i'm trying to do is create a web api so that when I make GET calls to www.example.com/myapp/api/table it returns json of my database. Then www.example.com/myapp/api/table/3 will return table row 3. RIght now i just want it to print some text so I know the right function is getting called.</p>