Reputation: 31003
How do I catch the following two urls in my urls.py?
example.com
example.com/
Right now I'm doing:
from django.conf.urls import patterns, url, include
urlprefix = 'websites.app'
urlpatterns = patterns(urlprefix,
(r'index/$', 'public.views.index'), # landing page
)
If I add:
(r'$', 'public.views.index'), # landing page
as a catch-all, then it gets all rules. I just want it to go to index when there's a trailing slash or nothing past the base url.
Upvotes: 0
Views: 1205