0

I'm redirecting non www to www in my django project. So far its in fact working by setting the PREPEND_WWW = True in my settings.py

But somehow when I enter mysite.com it will redirect me to www.mysite.com/mysite/mysite/wsgi.py

Is it possible just to redirect it to www.mysite.com?

ManaAyako
  • 1
  • 1
  • Not sure what might be causing the problem. But, usually it's a better idea to do this kind of redirect outside Django (e.g. at Nginx). It would solve your problem anyway http://stackoverflow.com/questions/7947030/nginx-no-www-to-www-and-www-to-no-www – Vitor Freitas May 21 '16 at 17:56

1 Answers1

0

I deleted all .pyc files from my project and ran the server with the python manage.py runserver --noreload command + reloaded my apache service.

Somehow this fixed my problem. Django was acting weird!

ManaAyako
  • 1
  • 1