Redirect

0 views
Skip to first unread message

Zeynel

unread,
Nov 15, 2009, 12:35:18 PM11/15/09
to Django users
hello,

how do i redirect www.swimswith.com to www.swimswith.com/admin/

Thanks

Dennis Kaarsemaker

unread,
Nov 15, 2009, 1:01:50 PM11/15/09
to django...@googlegroups.com
On zo, 2009-11-15 at 09:35 -0800, Zeynel wrote:

> how do i redirect www.swimswith.com to www.swimswith.com/admin/

In your urlpatterns:
('^$', lambda *args: HttpResponseRedirect('/admin/'))

Or make your webserver do this, e.g. in apache:

RewriteEngine On
RewriteRule ^/$ /admin/ [R,L]

--
Dennis K.

The universe tends towards maximum irony. Don't push it.

Andy McKay

unread,
Nov 15, 2009, 1:04:47 PM11/15/09
to django...@googlegroups.com
On 09-11-15 9:35 AM, Zeynel wrote:
> how do i redirect www.swimswith.com to www.swimswith.com/admin/

http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-generic-simple-redirect-to

First hit in Google.
--
Andy McKay, @clearwind
Training: http://clearwind.ca/training/

Zeynel

unread,
Nov 15, 2009, 2:13:04 PM11/15/09
to Django users
I couldn't make this one work:

('^$', lambda *args: HttpResponseRedirect('/admin/'))

I want to try the other case, which file in apache do I use?

Thanks
Reply all
Reply to author
Forward
0 new messages