₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,843 members, 8,423,892 topics. Date: Wednesday, 10 June 2026 at 11:59 AM

Toggle theme

Redirect Code - Webmasters - Nairaland

Nairaland ForumScience/TechnologyWebmastersRedirect Code (822 Views)

1 Reply (Go Down)

Redirect Code by LordReed(op): 11:35pm On Mar 17, 2012
Please someone help me with this code:

<script language="javascript">
location.replace(" http://www.yournewsite.com");
</script>
<meta http-equiv="refresh" content="1;
url=http://www.yournewsite.com">
<a href="http://www.yournewsite.com"><font
face="arial,helvetica">My new page is here...</
font></a>

Can I replace http://www.yournewsite.com with an ip address?
Re: Redirect Code by Nobody: 12:52am On Mar 18, 2012
Hmm for security purposes, i doubt if you can use location.replace for a browser address different from the current one your browser is on.
There is a certain restriction law in jscript i dont quite remember clearly. Well, here is how to go about it, use mozilla firefox to run the code, and use the error console to see what error message it returns.
I am expecting you to get an access-denied kinda error, your syntax appears correct sha.
Re: Redirect Code by LordReed(op): 4:07am On Mar 18, 2012
@dhtml
The code is suppose to automatically redirect the page to the new address. I am a novice in html matters so your help is greatly appreciated.
Re: Redirect Code by yamakuza: 4:20am On Mar 18, 2012
Lord_Reed: Please someone help me with this code:

<script language="javascript">
location.replace(" http://www.yournewsite.com");
</script>
<meta http-equiv="refresh" content="1;
url=http://www.yournewsite.com">
<a href="http://www.yournewsite.com"><font
face="arial,helvetica">My new page is here...</
font></a>

Can I replace http://www.yournewsite.com with an ip address?
try http://xx.yy.zz/ or http://xx.yy.zz:80/ and see what happens.

Where xx.yy.zz is of course, an ip address

btw, ur l_m_r dey bounce
Re: Redirect Code by LordReed(op): 6:22am On Mar 18, 2012
Thanks guys, I just checked the website dashboard and it allows me to configure redirects so I'm gonna use that instead of fiddling with the html code.
Re: Redirect Code by Nobody: 7:16am On Mar 18, 2012
Sorry, i was already feeling rather sleepy then. I have not used the location.replace for a long time, but if it does not work, you can always go back to location.href
1 Reply

Help! Blog Title Won't Redirect To Home Page (pictured)Adsense - Difficult To Navigate, Redirect, Pop Up Issues?How To Redirect 1and1 Domain To Your Bloggers Blog234

Danbaba.com Is For Sale!Make Cool 100doll@rs Weekly From Liberty Reserve!!!What Would You Use Nigeria.bz For?