Which redirect code is better to use, Meta redirect or Javascript?
Question about Redirect codes
Collapse
X
-
Question about Redirect codes
Tags: None -
Thanks. I was using Meta redirect for my tgp, but about every few clicks or page refreshes, the page would not load.Originally posted by Wizard-XAs I remember it, meta redirects cause issues with search engines so javascript is usually the way to go for an instant redirect.
This is the js code that I'm now using, is this the right one?
<html>
<head>
<title>Kelly Knows Best - Your Free Source For Todays Hottest Porn</title>
</head>
<body>
You will be redirected to http://www.kellyknowsbest.com.
<script language="JavaScript">
var URL = "http://www.kellyknowsbest.com/tgp.html";
self.location = URL;
</script>
</body>
</html>Last edited by DeloreanRider99; 03-22-2006, 08:38 AM.Comment
-
that should work but I am no javascript expert. I have seen javascript be flakey especially in other browsers like firefox. Try referencing it using 'top' instead of 'self'. Theoretically in your case they are the same thing but browsers are flakey..Comment
-
I'll give that a try, thanks.Originally posted by Wizard-Xthat should work but I am no javascript expert. I have seen javascript be flakey especially in other browsers like firefox. Try referencing it using 'top' instead of 'self'. Theoretically in your case they are the same thing but browsers are flakey..
Comment
-
I typically do my redirects with php. Doing something like...
...has the benefit of sending an actual 302 before forwarding the client browser, and of course, because it's PHP and not a simple HTML thing, you've got control structures and branching abilities. Google recommend in their own documentation that if you must redirect a browser to another page, then using a 302 is the best practice - this may change with the 302 issues currently swirling around the place.Code:<? header("Location: your.url"); ?>
One note however, this method will not work if you are outputting something to the client's browser before the forwarding.
CASH APARTMENT V2 IS HERE!
NATS POWERED, 60-70% ON ALL REBILLS, FREE CONTENT, MGPS, FHGS, RETAINING MEMBERS NETWORK!
A SIMPLE NO B.S PROGRAM - ICQ 239 806 698Comment
-
Originally posted by babsyI typically do my redirects with php. Doing something like...
...has the benefit of sending an actual 302 before forwarding the client browser, and of course, because it's PHP and not a simple HTML thing, you've got control structures and branching abilities. Google recommend in their own documentation that if you must redirect a browser to another page, then using a 302 is the best practice - this may change with the 302 issues currently swirling around the place.Code:<? header("Location: your.url"); ?>
One note however, this method will not work if you are outputting something to the client's browser before the forwarding.
Sorry about my ignorance, but what you mean with "302" ?
Adult Sex Store - Take a look to our sex store, we have a huge collection of the best adult DVDs on internet
Sex Store where you can get the last Adult DVDs from the xxx entertainmentComment
-
302 is an example of a HTTP header code that gets sent to the client's browser. It tells the browser that the page you're viewing is temporarily redirected to this new one. A 301 header tells the browser it is a permanent redirection.Originally posted by Kal-elSorry about my ignorance, but what you mean with "302" ?
Doing the redirection like that will send a 301. As to which one you want to use, your guess is as good as mine. According to google themselves (google.com/webmasters/3.html), they very definitely will crawl 301s, however, they will crawl it as the URL you redirect TO. As things currently stand with google, if you send a 302, they crawl it as the URL you redirect FROM - which is the source of the whole 302 Redirect scandal that has been going on for the past while. I really have no idea how google plan on fixing the problem. Perhaps if the content you're 302ing to is on the same domain they'll be fine with it, but if it crosses domains, it gets a page rank hit? Who really knows. Suffice to say, these issues are far beyond the scope of this thread.Code:<? header("HTTP/1.0 301 Moved Permanently"); header("Location: your.url"); ?>
CASH APARTMENT V2 IS HERE!
NATS POWERED, 60-70% ON ALL REBILLS, FREE CONTENT, MGPS, FHGS, RETAINING MEMBERS NETWORK!
A SIMPLE NO B.S PROGRAM - ICQ 239 806 698Comment


Comment