diff --git a/wagtail/wagtailcore/models.py b/wagtail/wagtailcore/models.py index e3a80161d1..a237e16e6d 100644 --- a/wagtail/wagtailcore/models.py +++ b/wagtail/wagtailcore/models.py @@ -489,7 +489,7 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, indexed.Index """Return the full URL (including protocol / domain) to this page, or None if it is not routable""" for (id, root_path, root_url) in Site.get_site_root_paths(): if self.url_path.startswith(root_path): - return root_url + reverse('wagtail', args=(self.url_path[len(root_path):],)) + return root_url + reverse('wagtail_serve', args=(self.url_path[len(root_path):],)) @property def url(self): @@ -504,7 +504,7 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, indexed.Index root_paths = Site.get_site_root_paths() for (id, root_path, root_url) in Site.get_site_root_paths(): if self.url_path.startswith(root_path): - return ('' if len(root_paths) == 1 else root_url) + reverse('wagtail', args=(self.url_path[len(root_path):],)) + return ('' if len(root_paths) == 1 else root_url) + reverse('wagtail_serve', args=(self.url_path[len(root_path):],)) def relative_url(self, current_site): """ @@ -514,7 +514,7 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, indexed.Index """ for (id, root_path, root_url) in Site.get_site_root_paths(): if self.url_path.startswith(root_path): - return ('' if current_site.id == id else root_url) + reverse('wagtail', args=(self.url_path[len(root_path):],)) + return ('' if current_site.id == id else root_url) + reverse('wagtail_serve', args=(self.url_path[len(root_path):],)) @classmethod def search(cls, query_string, show_unpublished=False, search_title_only=False, extra_filters={}, prefetch_related=[], path=None): diff --git a/wagtail/wagtailcore/urls.py b/wagtail/wagtailcore/urls.py index 9cc9ddfcf2..2e01bbfe03 100644 --- a/wagtail/wagtailcore/urls.py +++ b/wagtail/wagtailcore/urls.py @@ -10,5 +10,5 @@ urlpatterns = [ # a '/'. If a trailing slash is not present, we leave CommonMiddleware to # handle it as usual (i.e. redirect it to the trailing slash version if # settings.APPEND_SLASH is True) - url(r'^((?:[\w\-]+/)*)$', views.serve, name="wagtail") + url(r'^((?:[\w\-]+/)*)$', views.serve, name='wagtail_serve') ]