0

into my web.py python interface, I defined some URL :

urls = (
  '/publication/(.*)', 'PublicationStats',
  '/author/(.*)', 'AuthorStats',
  '/department/(.*)', 'DepartmentStats',
)

My department names always contains slash :

SST/IMNC - department_name1
SSH/FLTR - department_name2
...

When I try to call department url, I thought that if I encode the slash (%2F) all should works fine... but my URL seems decoded before URL management :(

If I use http://localhost/my_api/department/SST%2FIMNC%20-%20department_name1. The server result is : 404-Not Found : The requested URL /api/stats/author/SST/IMNC was not found on this server.

Don't know how to solve my problem ? A special configuration into Apache ? into mod_wsgi, into my web.py application ?

Thnaks for your help.

Renaud Michotte
  • 389
  • 4
  • 17
  • If you type `%2F` instead of `/` in the addresses in your browser, it will work without any problem. I'm afraid you will have to encode your params with an other method or choose another separator for your departments. Or you can see this comment: http://stackoverflow.com/questions/2992231/slashes-in-url-variables#comment42172440_2992259 – Tryph Oct 24 '16 at 12:30

1 Answers1

0

Solution found !

Into Apache configuration, I need to add the AllowEncodedSlashes directive to NoDecode value. See https://httpd.apache.org/docs/2.2/fr/mod/core.html#allowencodedslashes

Renaud Michotte
  • 389
  • 4
  • 17