Auto-Redirect

J

Jörg Heinrich

Hello NG,

i want to write an automatic-Redirection.

I use: <meta http-equiv="refresh" content="5;
URL=http://selfhtml.teamone.de/">

But now i read that this is not the best to do that like that.

Is there any better solution for a automatic-redirection?

Thanks!
Joerg
 
C

chris

Jörg Heinrich said:
Hello NG,

i want to write an automatic-Redirection.

I use: <meta http-equiv="refresh" content="5;
URL=http://selfhtml.teamone.de/">

But now i read that this is not the best to do that like that.

Is there any better solution for a automatic-redirection?

Thanks!
Joerg

With html: no. But there is with server side scripting like php. But whats
wrong with the meta tag? Doesnt it work? Simple task, simple sollution..
 
J

Jörg Heinrich

With html: no. But there is with server side scripting like php. But whats
wrong with the meta tag? Doesnt it work? Simple task, simple sollution..

How can i do it with PHP?
 
C

chris

Jörg Heinrich said:
How can i do it with PHP?

By rewriting the header. like <code>header ("Location:
filename.html");</code>
I dont know it excactly havent used it for some time. But it should work
 
C

Chris Morris

It doesn't always work, no. Some browsers don't support it, some
(including IE, in an obscure part of the settings) can disable it.
There's also a number of usability problems (broken back button,
disorientating users with some disabilities said:
How can i do it with PHP?

header("Location: http://www.example.com/new/location/");
exit;

If you're trying to redirect from
http://www.example.com/old.html to http://www.example.com/new.html
then you have two choices

1) Enable PHP parsing for HTML if your server supports it and your
admin will let you.

2) Delete old.html
Create a directory in the same place called old.html/
Put an index.php file in that directory that does the redirect

3) Not a PHP solution, but nicer than either of the above, *if* your
server supports it: Use .htaccess to do the redirect - plenty of
.htaccess tutorials about on the web.
 
C

chris

Chris Morris said:
sollution..

It doesn't always work, no. Some browsers don't support it, some
(including IE, in an obscure part of the settings) can disable it.
There's also a number of usability problems (broken back button,


header("Location: http://www.example.com/new/location/");
exit;

If you're trying to redirect from
http://www.example.com/old.html to http://www.example.com/new.html
then you have two choices

1) Enable PHP parsing for HTML if your server supports it and your
admin will let you.

2) Delete old.html
Create a directory in the same place called old.html/
Put an index.php file in that directory that does the redirect

3) Not a PHP solution, but nicer than either of the above, *if* your
server supports it: Use .htaccess to do the redirect - plenty of
.htaccess tutorials about on the web.

Ahh yes good old .htaccess I totally forgot it. And thanx for the info on
the meta. I didnt knew.

chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top