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
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
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.
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
--~--
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(
5 matches
Mail list logo