Client-side redirect là các sự kiện chuyển hướng xảy ra hoàn toàn ở client-side mà không cần bất kỳ sự tương tác nào với server-side. Client-side redirect có thể được gây ra bởi JavaScript hoặc thẻ <meta>.
Đối với JavaScript, chúng ta sử dụng biến window.location hoặc window.location.href để thực hiện chuyển hướng trang web đến một URL mới.
Ví dụ:
setTimeout(function () {
window.location.href = "https://example.com"
}, 3000)Nếu sử dụng thẻ <meta> thì ta cần dùng thuộc tính http-equiv với giá trị là "refresh" kèm theo thuộc tính content có dạng như sau:
<meta http-equiv="refresh" content="5; URL='https://example.com'" />Related
list
from outgoing([[Client-Side Redirect]])
sort file.ctime asc