homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

html redirection

 6:02 pm on Apr 13, 2004 (gmt 0)

I would like to know if it possible to redirect to another page from a html page. f.ex from www.<mypage>.html to any other page wothout using php functions such as header(location ) - then I need to have .php instead of .html which I dont want....




 8:37 pm on Apr 13, 2004 (gmt 0)

There are many ways to redirect a page without PHP.

HTML, in the <HEAD>:

<meta http-equiv="Refresh" content="0; URL=http://domain.com/newpage.html">

"0" is the number of seconds to wait before redirecting

JavaScript, in the <HEAD>

<script language=JavaScript>window.location="newpage.html"</script>

Or if you want a delay:

<script language=JavaScript>setTimeout('window.location = "newpage.html"', '4000') </script>

4000 is the number of milliseconds to wait before redirecting.


.htaccess is a text file at the top level on your server (at the same level as your index.html). If it's not there you can create one. Add this command to the server to redirect pages:

Redirect 301 /oldpage.html [domain.com...]


 8:40 pm on Apr 13, 2004 (gmt 0)

yeah, you can even use rewrite ;)


 4:45 pm on Apr 14, 2004 (gmt 0)

I'd go for the .htaccess approach if I were you - Javascript has a habit of breaking the back button (if it's even enabled by the user).

Michael you seem very well versed in redirection!

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
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