This problem bugged me last week or so, and now I'm coming up with a deadline. I have a site on the Media Temple DV server that runs Drupal on webroot (servername.org). I am adding a django site and I would like it to be at url servername.org/myproject. I created a project (in a directory not in a web route) and it works fine when I run it using the django dev server, but I cannot configure apache to run my django site. I followed this tutorial http://how.4cpus.com/installing-django-on-mt-media-temple-dv-35-server-with-mod_python/
to do the initial setup and configure vhost..conf as described there. But the .htaccess file created by Drupal continues to grab my url and returns a 404 error.
The only work I have so far is that if I create a subdirectory in webroot called httpdocs / myproject and then go to the URL servername.org/myproject, it will work. But as soon as I try to go to any myproject subfolder (for example, servername / myproject / login), I get 404 error again.
Any help here? I know this should be a simple one or two Apache configuration settings, but I can't figure it out and I'm running out of ideas.
Here is a snippet of the vhost.conf file:
<Location "/myproject/">
SetHandler python-program
PythonPath "['/var/www/vhosts/servename.org/']+sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE myproject.settings
PythonInterpreter myproject
</Location>
And here is the Drutal.htaccess file in webroot (note the rewirte rule, which I put closer to the end, which does nothing):
<FilesMatch "\.(engine|inc|info|install|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
Order allow,deny
</FilesMatch>
Options -Indexes
Options +FollowSymLinks
ErrorDocument 404 /index.php
<Files favicon.ico>
ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>
DirectoryIndex index.php
<IfModule mod_php4.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
<IfModule sapi_apache2.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
<IfModule mod_php5.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
php_value mbstring.http_input pass
php_value mbstring.http_output pass
php_value mbstring.encoding_translation 0
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A1209600
<FilesMatch \.php$>
ExpiresActive Off
</FilesMatch>
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} "/myproject/"
RewriteRule (.*) $1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
[1]: http://how.4cpus.com/installing-django-on-mt-media-temple-dv-35-server-with-mod_python/