Fix canonical_url_processor
This commit is contained in:
parent
00d8a792d0
commit
e8d73b9909
1 changed files with 1 additions and 7 deletions
|
@ -5,12 +5,6 @@ def canonical_url_processor(request):
|
|||
if settings.DEBUG:
|
||||
canonical_url = request.build_absolute_uri()
|
||||
else:
|
||||
current_host = request.get_host()
|
||||
canonical_host = settings.CANONICAL_HOST
|
||||
|
||||
if current_host != canonical_host:
|
||||
canonical_url = f"{request.scheme}://{canonical_host}{request.get_full_path()}"
|
||||
else:
|
||||
canonical_url = request.build_absolute_uri()
|
||||
|
||||
canonical_url = f"{request.scheme}://{canonical_host}{request.get_full_path()}"
|
||||
return {'canonical_url': canonical_url}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue