View Full Version : Redirect Traffic
hamfast
01-21-2008, 10:19 AM
Hello there
Can anyone tell me the easiest way of redirecting traffic from my website at one url to another. Apart from the change of web address the website is exactly the same.
Thanks
tech_support
01-21-2008, 10:51 AM
<h1><a href="http://www.newlocation.com/">We've moved!. Click here if you're not redirected...</a></h1>
<script type="text/javascript">
setTimeout(function() { window.location='http://www.newlocation.com/'; },3000);
</script>
hamfast
01-21-2008, 11:09 AM
thanks techsupport - spot on
BLiZZaRD
01-21-2008, 02:38 PM
.htaccess would be better though. Although tech did include the fall back, click here link.
in .htaccess:
RedirectMatch permanent ^/page.html$ http://site.com/new.html
all on one line. red code is old page/site/etc/ blue is new one.
Briggs
01-22-2008, 05:22 AM
I like to use
<meta
http-equiv="refresh" content="0; url=your new address.html">
jscheuer1
01-22-2008, 09:36 AM
I like to use
<meta
http-equiv="refresh" content="0; url=your new address.html">
Though this is the only truly HTML way to do this, like the javascript solution, that can be turned off or fail. So, also like the javascript solution, an actual link to the new page should be present. Server side redirects are best if available. These can be accomplished in addition to in the .htaccess file, by using PHP, asp, and other server side languages.
tech_support
01-23-2008, 10:05 AM
I like to use
<meta
http-equiv="refresh" content="0; url=your new address.html">
That's now deprecated.
jc_gmk
01-23-2008, 12:48 PM
If you use PHP just create an index.php page and add the following line:
<?php header('Location: http://www.yoursite.com/'); ?>
hamfast
01-25-2008, 11:58 AM
I've tried various of the options above and am finding that the site im forwarding traffic to is fine in Internet Explorer but in Firefox is opening the ftp page (ie. showing the html)? What have I done wrong???
Thanks
H
jscheuer1
01-25-2008, 03:50 PM
I've tried various of the options above and am finding that the site im forwarding traffic to is fine in Internet Explorer but in Firefox is opening the ftp page (ie. showing the html)? What have I done wrong???
Thanks
H
Sounds like the mime type from the server of the new site is wrong.
If you navigate directly to the new page in FF, does it still display the source code, or is the page then shown correctly? If FF shows the page correctly, what methods did you try, and how did you implement them? If not, the mime type needs to be changed on the server.
hamfast
01-25-2008, 04:02 PM
Hi
I've navigated directly to the page in FF and it opens straight into the HTML code. Of the answers provided above the only one I didnt try was Blizzard's because I wasn't sure what the .htaccess file referred to. Ignorant I know.
The site has recently opened with hosts 123-Reg do I need to contact these guys??
Cheers
H
jscheuer1
01-25-2008, 04:19 PM
Hi
I've navigated directly to the page in FF and it opens straight into the HTML code. Of the answers provided above the only one I didnt try was Blizzard's because I wasn't sure what the .htaccess file referred to. Ignorant I know.
The site has recently opened with hosts 123-Reg do I need to contact these guys??
Cheers
H
Probably. Tell them that FireFox is showing the source code of the page and that you suspect that the mime type from the server is incorrect. However, before you do that, if you feel comfortable giving us the address to the page, and it isn't x-rated - give us the address to the page so we can check it out.
BLiZZaRD
01-25-2008, 11:26 PM
Hi
Of the answers provided above the only one I didnt try was Blizzard's because I wasn't sure what the .htaccess file referred to. Ignorant I know.
Not ignorant, just currently unknowing. open a plain text editor such as notepad, and put the code from my previous post (with the color edits) inside. File>> save as
In the save as menu, select the save destination (desktop is prolly best) and name it .htaccess (don't for get the ".") and from the file type drop down choose "all files" (this will prevent the .txt extension being placed on the end.
Once saved, use FTP to upload to the root folder of the server which holds the old page.
That's it.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.