RewriteEngine On

# if you're testing or using blog_my within a subdirectory, uncomment this
RewriteRule /subdirectory_name$ /subdirectory_name/ [L]

# allowed extensions
RewriteCond %{REQUEST_URI} !\.(css|html|gif|jpg|jpeg|png|js)$

# allowed subdirectories
#RewriteCond %{REQUEST_URI} !/(dir1|dir2|dir3)

# allowed other
RewriteCond %{REQUEST_URI} !blog_my.py

# redirect all other requests to blog_my
RewriteRule ^(.*) /blog_my.py/$1 [L]

# if you're testing or using blog_my within a subdirectory, use this rule instead
#RewriteRule (.*) /subdirectory_name/blog_my.py/$1 [L]

# if you want to enable to fastCGI mode, you may have to 
# change the extension or create a hardlink from blog_my.py to blog_my.fcgi
# and use the rewrite below:
#RewriteCond %{REQUEST_URI} !blog_my.fcgi
#RewriteRule ^(.*) /blog_my.fcgi/$1 [L]
