View Single Post
Old 12-08-2012, 11:21 PM   PM User | #1
Mayankode
New Coder

 
Join Date: May 2011
Posts: 27
Thanks: 4
Thanked 0 Times in 0 Posts
Mayankode is an unknown quantity at this point
Question Reg Expression to Exclude the contents of a Single folder

How can I exclude the contents of a folder using regular expressions.

Here is the code of the appspot app.yaml code.
Code:
handlers:
- url: /(.*\.(gif|png|jpg|ico|js|css))
  static_files: \1
  upload: (.*\.(gif|png|jpg|ico|js|css))

- url: /robots.txt
  static_files: robots.txt
  upload: robots.txt 

- url: /favicon.ico
  static_files: favicon.ico
  upload: favicon.ico
  
- url: .*
  script: main.py
  

error_handlers:
- file: default_error.html

- error_code: over_quota
  file: over_quota.html
I want any "file not found" 404 error arising in the folder /Codebox to be applied by error_handlers at the bottom of the code. Since the code is read from top and all handlers have to come above the error_handlers, I want to modify the code of the handlers so that they exclude the contents of the folder /Codebox and so that any error arising from this folder will be taken care by the error_handlers.

Please suggest a regexpression to exclude the contents of a single named folder. Thank you.
Mayankode is offline   Reply With Quote