homepage Welcome to WebmasterWorld Guest from 54.161.175.231
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
how to make a redirect page
thaker2002




msg:1475191
 11:34 pm on May 22, 2003 (gmt 0)

what is the code to redirect to a different page

 

madcat




msg:1475192
 12:03 am on May 23, 2003 (gmt 0)

Welcome to Webmaster World :)

Try a search, I'm certain you'll find what you are looking for.

mossimo




msg:1475193
 2:34 am on May 23, 2003 (gmt 0)

<META HTTP-EQUIV="Refresh" CONTENT="3; url=http://www.#.com">

"3" is how many seconds till the page redirects

davegerard




msg:1475194
 4:28 am on May 23, 2003 (gmt 0)

If you're using ASP you can do the following:

<%
response.buffer = true

NextPage = "http://..."
response.redirect NextPage
%>

However, you do not have control over the time element. It redirects immediately.

keyplyr




msg:1475195
 8:53 am on May 23, 2003 (gmt 0)


Some search engines will not index the referring page, just the destination. Other SEs may interpret a meta refresh as SPAM. Placing your redirect code in an external file will avoid both.

Create a .txt file with this:

window.location.replace("http://www.your_domain.com/page.html")

Rename it as a JS file, example: redirect.js

Then in the HEAD section of the redirecting page, add:

<script type="text/javascript" src="/redirect.js"></script>

Note: Also redirects immediately.

korkus2000




msg:1475196
 5:37 pm on May 23, 2003 (gmt 0)

Server side is the best way to go unless you are OK with a link on the page for SEs and nonjavascript users.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved