i have 2 websites, i want to make a new website and include both of my sites in that website and show them in index page and i want to redirect my index page to my other websites after 10-15 seconds only.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Heya,
Based on your question, it sounds like you want to create a new landing page that displays links to your two other websites and then automatically redirects the user to these sites after 10-15 seconds. This can be done by creating a simple HTML page with JavaScript for the automatic redirection.
Here’s an example of how you can set this up:
This code creates a new HTML document with links to your two other websites. The JavaScript code sets a timer that redirects to the first URL after the delay specified (10 seconds in this case), and then redirects to the second URL after another delay, and so on.
Note that this is a simple implementation and does not persist the counter between page loads. That means if a user visits your page, they will always be redirected to the first URL after the delay. If you want to alternate between the two URLs for a single user, you will need to store the counter in a more persistent manner, like a cookie or local storage.
Remember to replace
'http://your-first-website.com'
and'http://your-second-website.com'
with the actual URLs of your two websites.Please note that auto-redirecting can create a confusing user experience and is generally not recommended. Consider using this sparingly and informing the user that they will be redirected.
You can redirect it with HTML, PHP or Java-script.
Here are the code for HTML: create index.html and place this code in head HTML
Change content to any value its in seconds