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
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
HTML Code:<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>
Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
Currently: enjoying the early holidays :)Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide
thanks techsupport - spot on
.htaccess would be better though. Although tech did include the fall back, click here link.
in .htaccess:
all on one line. red code is old page/site/etc/ blue is new one.Code:RedirectMatch permanent ^/page.html$ http://site.com/new.html
{CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
Follow Me on Twitter: @InkingHubris
PHP Code:$result = mysql_query("SELECT finger FROM hand WHERE id=3");
echo $result;
I like to use
Code:<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.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
Currently: enjoying the early holidays :)Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide
If you use PHP just create an index.php page and add the following line:
PHP Code:<?php header('Location: http://www.yoursite.com/'); ?>
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.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Bookmarks