Setup mod-rewrite
- by Publiccert
I'm trying to setup mod-rewrite for a few servers.
The code lives in /home/jeff/www/upload/application/
However, this is what's happening. It appears to be a problem with mod-rewrite since it's appending code.py to the beginning of the directory:
The requested URL /code.py/home/jeff/www/upload/application/ was not found on this server.
Here are the rules. Which one is the culprit?
WSGIScriptAlias / /home/jeff/www/upload/application
Alias /static /home/jeff/www/upload/public_html
<Directory /home/jeff/www/upload/application>
SetHandler wsgi-script
Options ExecCGI FollowSymLinks
</Directory>
AddType text/html .py
<Location />
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/static
RewriteCond %{REQUEST_URI} !^(/.*)+code.py/
RewriteRule ^(.*)$ code.py/$1 [PT]
</Location>
</VirtualHost>