gpt-4o-2024-08-06· OpenAI
WildChat-4.8M (AI2)
Url redirection html
- User
Url redirection html
- Assistant
To perform a URL redirection in HTML, you typically don't use HTML alone but combine it with a bit of JavaScript or a meta tag. Here are two common methods to achieve URL redirection:
Method 1: Using a
metatagYou can use the
<meta>tag within the<head>section of your HTML document to redirect the page after a specified number of seconds. Here’s an example that redirects the page tohttps://www.example.comafter 5 seconds:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="refresh" content="5;url=https://www.example.com"> <title>Page Redirection</title> </head> <body> <p>You are being redirected. If you are not redirected automatically, follow this <a href="https://www.example.com">link</a>.</p> </body> </html>