Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6346057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:56:42+00:00 2026-05-24T20:56:42+00:00

It seems Flask doesn’t support routes with a URI encoded component. I’m curious if

  • 0

It seems Flask doesn’t support routes with a URI encoded component. I’m curious if I’m doing something wrong, or if there is a special flag I need to include.

My route looks something like this:

@app.route('/foo/<encoded>/bar/')
def foo(encoded):
  # ...
  pass

The URL that this should match can look like these:

http://foobar.com/foo/xxx/bar/ # matched correctly, no URI component
http://foobar.com/foo/x%2Fx%2Fx%2F/bar/ # not matched correctly, URI component

Former URL works, latter spits out a lovely 404.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:56:44+00:00Added an answer on May 24, 2026 at 8:56 pm

    Add path to your url rule:

    @app.route('/foo/<path:encoded>/bar/')

    Update per comment: The route API docs are here: http://flask.pocoo.org/docs/api/#flask.Flask.route. The underlying classes that implement the path style route converter are here: http://werkzeug.pocoo.org/docs/routing/#custom-converters (this is one of the really nice parts of pocoostan.) As far as the trailing slashes, there are special rules that amount to:

    If a rule ends with a slash and is requested without a slash by the
    user, the user is automatically redirected to the same page with a
    trailing slash attached.

    If a rule does not end with a trailing slash and the user request the
    page with a trailing slash, a 404 not found is raised.

    Also keep in mind that if you are on Apache and are expecting a slash-trailed url, ie a bookmarklet that submits to http://ex.com/foo/<path:encoded>/bar and encoded gets something with double slashes, Apache will convert multiple slashes to a single one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Since SilverLight doesn't natively supports the use of microphone, is there a workaround I
is it true that Rails depend on cookies? It seems that flash is a
It seems to me that the key USP of Flash/Silverlight is the ability to
One thing that seems particularly easy to do in the Flash IDE but difficult
Is there any equivalent to a Flash projector for iPhone? Flash projectors basically seem
Seems to me most of developers completely ignore this features. People prefer handling security
Seems like a simple enough question but I can't seem to find the answer.
Seems like a simple problem: I have an SVN repo inside our firewall. I
Had a question and if anyone has found similar issues. It seems my file
AS3 documentation says that Strings in AS3 are in UTF-16 format. There is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.