PDA

View Full Version : Auto Redirect?



HabbDance
07-11-2008, 11:15 PM
Is there any way to 'auto-redirect' a site using javascript?
For example, http://habbcrazy.net/ redirects to http://habbcrazy.net/hcv3
Thanks in advance :D +rep

hamheyelliot
07-11-2008, 11:17 PM
Just use the META tag?

<meta http-equiv="refresh" content="2;url=http://webpage.com">

Content being the time in which you want it to redirect, and the webpage.. well you know that.

Trinity
07-11-2008, 11:18 PM
It would be better to use PHP if you want it to redirect instantly.


<?php
header( 'Location: http://www.redirected.com' ) ;
?>

HabbDance
07-11-2008, 11:19 PM
Just use the META tag?

<code><meta http-equiv="refresh" content="2;url=http://webpage.com"></code>

Content being the time in which you want it to redirect, and the webpage.. well you know that.
Well that was easy :P Thanks alot, +rep

hamheyelliot
07-11-2008, 11:20 PM
No problem. Just don't put in the <code> bit. That was me not knowing HabboxForum Tags =P

Jackboy
08-11-2008, 12:16 PM
Well that was easy :P Thanks alot, +rep

Lol, no offense but i thought you could code...

Josh-sama
08-11-2008, 12:42 PM
Exactly HabbDance you pretty much implied you were the best coder here...

Jebbo.
08-11-2008, 12:45 PM
http://www.google.co.uk/search?hl=en&q=javascript+redirect&btnG=Google+Search&meta=

Awfy
08-11-2008, 12:47 PM
Or if you have cPanel just make your root domain go to your directory...

HabbDance
08-11-2008, 12:52 PM
Lol, no offense but i thought you could code...


Exactly HabbDance you pretty much implied you were the best coder here...
You two really need to stop. I never said I was the best coder or anything of the sort. Really, just stop posting in all of my threads saying I suck to get your post count up.


http://www.google.co.uk/search?hl=en&q=javascript+redirect&btnG=Google+Search&meta=
I could have done that if I want, don't you think? I think it's easier just to post here...


Or if you have cPanel just make your root domain go to your directory...
Thanks, never thought of that. +rep

Anyway, close this thread please.

Jahova
08-11-2008, 12:59 PM
Do it with the PHP header tags, it instantly re-directs you.

HabbDance
08-11-2008, 01:01 PM
Do it with the PHP header tags, it instantly re-directs you.
Hamilliet's (or something like that) way worked, but then I switched to awfy's way, it's alot simpler. Thanks though.

hamheyelliot
08-11-2008, 01:10 PM
Hamilliet? Dear lordeh.

Josh-sama
08-11-2008, 01:14 PM
You two really need to stop. I never said I was the best coder or anything of the sort. Really, just stop posting in all of my threads saying I suck to get your post count up.


I could have done that if I want, don't you think? I think it's easier just to post here...


Thanks, never thought of that. +rep

Anyway, close this thread please.

I don't really care about my postcount little boy...
Stop thinking with your excuse of a penis and use your head.

You have been bragging about coding, "MAH GUIDEZ BETTA" which indicates you believe you are a better coder. :rolleyes:

Calon
08-11-2008, 01:17 PM
If you still need the JS..



window.location = 'page.html';

HabbDance
08-11-2008, 01:19 PM
Lol ham sorry ^.^

If you still need the JS..



window.location = 'page.html';

Thanks but, what was actually wrong was for some reason home.html was the start page over index.php, so all I had to do was rename home.html to homepage.html

Thanks to all :] Except Josh >:]

Jackboy
08-11-2008, 04:34 PM
You two really need to stop. I never said I was the best coder or anything of the sort. Really, just stop posting in all of my threads saying I suck to get your post count up.



Wow?

This is the first time i have posted about it. Your obviously too immature to take criticism without sulking. -rep when i can

Josh-sama
08-11-2008, 08:19 PM
Lol ham sorry ^.^

Thanks but, what was actually wrong was for some reason home.html was the start page over index.php, so all I had to do was rename home.html to homepage.html

Thanks to all :] Except Josh >:]

Really think I care if you say thank you to me or not? :rolleyes:

Decode
08-11-2008, 08:21 PM
Its best to do it in PHP because then your browser doesn't have to load any content, so the redirect is quicker.

HotelUser
08-11-2008, 08:55 PM
Its best to do it in PHP because then your browser doesn't have to load any content, so the redirect is quicker.

Yeah, using <?php header('Location: http://.google.com'); ?> is the best way to go, just make sure there's no output before you use it. Otherwise you'll get an error.

Meti
09-11-2008, 08:24 PM
I always use cPanel redirect.

Want to hide these adverts? Register an account for free!