D
D
Dev_nab2021-08-05 19:06:09
Django
Dev_nab, 2021-08-05 19:06:09

How to make all links go through the site first?

Website in django.
For example, in YouTube, if you post a link, then it first passes through the site itself, then it goes redirect.
External link in the comments -
https://example.com

On YouTube it will be something like this -
https://www.youtube.com/redirect?event=video_descr... <token here>example.com

How to do the same on my site ?
So that all links posted by users first pass through the site itself, and then there is a redirect.
Through JavaScript to replace href="" throughout the html page or is there a better way through django itself?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2021-08-05
@Dev_nab

Analyze the sent data, extract links from them and replace them with your own.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question