title: Flask redirect to URL with variable
body: <p>I want to make a redirection to a URL and pass variable 'file' to it , can someone please help . Here is the view : </p>
  
  <pre><code>@app.route('/api/uploads/&lt;string:file&gt;/', methods=['GET','COPY']) 
  def download(file):
     sub = db.session.query(func.max(Content.Hits).label('max_hit')).subquery()
    contenu = db.session.query(Content).join(sub, sub.c.max_hit == Content.Hits).all()
  name1 = contenu[0].name
  
  if name1 == file:
     return redirect('http://192.168.198.134:5000/api/uploads/&lt;string:file&gt;', file)
  
  else:   
      return send_from_directory(UPLOAD_FOLDER, file) 
  </code></pre>