Soldato
- Joined
- 14 Apr 2004
- Posts
- 11,886
- Location
- UK
Just a very simple question please, how can I redirect one webpage to another (main homepage).
Thanks
Thanks

<html>
<head>
<title>Redirecting...</title>
<script language="JavaScript">
self.location.href='http://www.website.com';
</script>
</head>
<body>
</body>
</html>
<head>
<title>Redirect</title>
<meta HTTP-EQUIV="REFRESH" content="2; url=http://www.website.com">
</head>
What about people who disable meta-refreshes, or use a user-agent that doesn't support/allow them? Both methods also have negative impact with search engines. The javascript redirection will not work with spiders, and the latter is often a trick of spammers (gateway pages) and so can trigger penalties.Gaverick said:Another way to do it, this way will not leave out those people who browse with scripts disabled for security reasons.
RedirectPermanent /oldpage.htm http://www.example.com/newpage.htm
This sounds like a winning plan to me. Now Aug-dude, please explain it to the clueless (like me)...Augmented said:best to do it serverside, using a 301 (Moved Permanently) redirect. Very simple on Apache-based hosting...
Yes. If you want to redirect /index.htm to http://www.your-site.com/home.php, for example, then your rule would be:Raist said:You're saying that we just create a file and plop it in the root, file named ".htaccess" -- oldpage.htm I'm guessing should be the index.htm ?
RedirectPermanent /index.htm http://www.your-site.com/home.php
.htaccess files are never seen by the browser, it all happens on the server-side. When a server receives a request for a resource (like index.htm or header.jpg), it checks several places for anything that might need doing to that request. This can be in the main server config, the virtualhost definition for the individual site or an .htaccess in the site directories.The new location I understand. So a browser will automatically look for .htaccess before index.htm? I never did understand server-side instructions regarding page access.![]()