PDA

View Full Version : Redirect my site in a search-engine-spider-friendly way


Grover
Fri 30th Jul '04, 8:59am
Hi,

I have the following directory-structure on my server:

/public_html
/public_html/site1
/public_html/site2

Forget about site 2: On site 1 there's my VBulletin-forum.

Right, when a visitor goes to www.site1.nl (http://www.site1.nl/) , a server-configuration redirects the user to /public_html/site1. I do not use .htaccess in /public_html

The thing is: I do not have content pages yet, so my 'site1' consist only of my VB forum. Since my forum is located at: /public_html/site1/forum, I had to re-direct my visitors to that map. So I created an index.htm in /public_html/site1 with this content:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="refresh" content="0;URL=http://www.site1.nl/forum/index.php">
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
</body>
</html>


Recently I learned (see: http://www.tamingthebeast.net/articles3/spiders-301-redirect.htm) that search-engine spiders do not like a meta-refresh. So I changed the above file to:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<! -- meta http-equiv="refresh" content="0;URL=http://www.site1.nl/forum/index.php" -- >
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
</body>
</html>


... and added a .htaccess-file to /public_html/site1 with this content:


Redirect /index.htm http://www.site1.nl/forum/index.php


My question is : I have read somewhere (but can not find it back) that even a .htaccess has it's cons in this matter and that it would be best to use a javascript-solution for redirecting a page.

Is this true, or is the above solution good enough?

Floris
Fri 30th Jul '04, 9:24am
.htaccess is server side
and javascript is client side.

index spiders can ignore javascript, they can't ignore server side script.

Always try to use server side where possible.

Grover
Fri 30th Jul '04, 10:43am
.htaccess is server side
and javascript is client side.

index spiders can ignore javascript, they can't ignore server side script.

Always try to use server side where possible. Thank you, Floris.