Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

html redirection

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

New User

10+ Year Member

joined:Feb 14, 2004
votes: 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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 12, 2003
votes: 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)

Junior Member

10+ Year Member

joined:July 28, 2003
votes: 0

yeah, you can even use rewrite ;)
4:45 pm on Apr 14, 2004 (gmt 0)

Preferred Member

10+ Year Member

joined:Apr 4, 2004
votes: 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!


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members