I’ve setup an Apache web server with mod_wsgi, and have successfully modified the basic_project of DjangoBB to be called from Apache under the site’s /forum/ subtree. The problem I have is that the WSGI app receives (correctly) URLs without the /forum/ prefix, but produces URLs in the result pages that do not have any prefix.
Example of the issue: opening http://site/forum/ brings up the start page of the DjangoBB forum; the Log In link points to http://site/account/signin/ instead of the desired http://site/forum/account/signin.
How can I make all URLs produced by the DjangoBB app to include a custom prefix (/forum/ in my case) ?
UPDATE (as requested):
The part of httpd.conf that configures the project for use under WSGI:
WSGIPythonPath /var/www/forum:/var/www/forum/xforum:/var/www/forum/venv/lib/python2.7/site-packages
WSGIScriptAlias /forum /var/www/forum/xforum/wsgi.py
<Directory /var/www/forum/xforum>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
Note that, without including both the project dir (…/forum/xforum) and its parent (…/forum), the WSGI app didn’t work correctly.
In
settings.pyof the project, theFORCE_SCRIPT_NAMEshould be the prefix of the project’s URLs beginning with a slash (/):In my case, it should be: