0

I'm trying to put my Django site in a subpath, say www.example.com/mysite/ but I can't get it to work 100%.

I read up on the answer Django Apache Redirect Problem , where it is suggested to just change the site in the admin from www.example.com to www.example.com/mysite/, which is exactly what I want to do and it almost works. All urls in the main urls.py gets redirected properly, but everything in the includes drop the "mysite" directive when using the links in the templates (one example is {% url journal_index %} which after the change should go to www.example.com/mysite/journal but goes go www.example.com/journal/).

Hope this makes sense.

Cheers!

Community
  • 1
  • 1
mistalaba
  • 558
  • 1
  • 7
  • 19
  • are you specifically using Apache? if not, see http://stackoverflow.com/q/11292217/236081 for an Nginx solution – lofidevops Apr 12 '16 at 12:31

1 Answers1

2

Try adding the FORCE_SCRIPT_NAME setting:

FORCE_SCRIPT_NAME = '/mysite'

professorDante
  • 2,290
  • 16
  • 26