Something on our host was driving me crazy for hours yesterday.
after deploying to mysite.com/directory, when I followed a link (say about-us) it would take me to mysite.com/about-us instead of mysite.com/directory/about-us.
I thought it might be related to the Site settings and even tried the shell:
>>> from django.contrib.sites.models import Site
but that returned mysite.com/directory.
Fortunately support at webfaction is pretty quick and smart and they pointed us to a variable in the settings file. If you’re having that same problem just add:
FORCE_SCRIPT_NAME = "/directory"
(with no forward slash)
Maybe you’re testing your site, maybe you want to leave it in the Deep Web …
in any case if you want to display a “radioactive!!, do not index” sign for search engines you need a robots.txt file at the root of your directory.
So if your site is mysecretsite.com, you want it to be at
To ban all access simply copy paste this in your file,
User-agent: * Disallow: /
LoadModule alias_module modules/mod_alias.so
alias /robots.txt /home/myusername/webapps/mywsgiapp/some-directory/robots.txt
For the first time, the tech support at @ my host (webfaction ) feels like I’ve said “Shibboleet!”