Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] handle i18n URLs #3

Open
capi1O opened this issue Sep 21, 2018 · 0 comments
Open

[Feature Request] handle i18n URLs #3

capi1O opened this issue Sep 21, 2018 · 0 comments

Comments

@capi1O
Copy link

capi1O commented Sep 21, 2018

Currently my robots.txt is

User-agent: *
Disallow: /oauth/*
Disallow: /api-auth/*
Disallow: /en/login/*
Disallow: /en/admin/*
Disallow: /en/page-1/*

Host: my.website.com
Sitemap: http://my.website.com/sitemap.xml

with url.py


urlpatterns = [
	url(r'^oauth/', include('social_django.urls', namespace='social'), robots_allow=False),
	url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'), robots_allow=False),
	url(r'^sitemap\.xml$', sitemap),
	url(r'^robots\.txt$', url_robots_views.robots_txt)
]

# i18n URL patterns
urlpatterns += i18n_patterns(
	url(r'^admin/', include(admin_urlpatterns), robots_allow=False),
	url(r'^login/', some_view), robots_allow=False),
	url(r'^page-1/', some_view), robots_allow=False),
	url(r'^page-2/', some_view)),
	url(r'^page-3/', some_view))
)

better output would be :

User-agent: *
Disallow: /oauth/*
Disallow: /api-auth/*
Disallow: /*/login/*
Disallow: /*/admin/*
Disallow: /*/page-1/*

Host: my.website.com
Sitemap: http://my.website.com/sitemap.xml

in order to handle all i18n URLs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant