Tri Noensie
Tri Noensie

Reputation: 826

Catching the url path following a python cgi script?

It's better if I do an example to explain my question:

Filename of cgi script: 'awesome'
URL: http://omgpython.com/awesome
'awesome' script runs normally.

I append a 'fake' path: '/omg/so/fake'
URL: http://omgpython.com/awesome/omg/so/fake'

'awesome' script runs normally without any errors, but is it possible to catch the 'fake' path within 'awesome'?

I'm trying to clean the URL by not using URL params.

Upvotes: 2

Views: 1767

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798764

You want os.environ['PATH_INFO']. In the second example it will contain "/omg/so/fake".

Upvotes: 2

Related Questions