Welcome to WebmasterWorld Guest from 54.160.131.144

Forum Moderators: incrediBILL

Message Too Old, No Replies

html redirection

     

bagheera

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

10+ Year Member



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....

thanks,

MichaelBluejay

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

WebmasterWorld Senior Member 10+ Year Member



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

.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...]

digitsix

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

10+ Year Member



yeah, you can even use rewrite ;)

j4mes

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

10+ Year Member



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!

 

Featured Threads

Hot Threads This Week

Hot Threads This Month