Re: Redirect home page

2009-10-12 Thread ashbii
I second Graeme's suggestion. It should make your life easier regarding translations. On Oct 11, 1:54 pm, Graeme Glass wrote: > On Oct 11, 12:24 am, Caisys wrote: > > > Hi, > > I would like visitors to my site homepagewww.example.comtobe > > redirected towww.example.com/en/inorder to allow for

Re: Redirect home page

2009-10-11 Thread Graeme Glass
On Oct 11, 12:24 am, Caisys wrote: > Hi, > I would like visitors to my site homepagewww.example.comto be > redirected towww.example.com/en/in order to allow for translations > in the future. > > What is the most efficient way? > > 1- Use apache mod-rewrite? > 2- I know i could use the HttpRespon

Re: Redirect home page

2009-10-11 Thread Caisys
Thanks On Oct 11, 8:15 am, jeffschenck wrote: > The simplest option is probably to use the redirect generic view > (http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views- > generic-simple-redirect-to). You could add something like this to your > urlconf: > > (r'^$', 'django.views.

Re: Redirect home page

2009-10-10 Thread jeffschenck
The simplest option is probably to use the redirect generic view (http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views- generic-simple-redirect-to). You could add something like this to your urlconf: (r'^$', 'django.views.generic.simple.redirect_to', {'url': '/en/'}), jeff --~--

Re: Redirect home page

2009-10-10 Thread Kurt Neufeld
You could use middleware to do this as I learned last week, but why not just make a "view" which is only a function. urls.py: ... (r'^$', 'views.DomainRootRedirect' ) ... views.py: def DomainRootRedirect( request, *args, **kwargs ): return HttpResponseRedirect(