Forum Moderators: open
I have various domains all on the same server package. I want to host various websites on this same server package, so i have been told i should make an index file with html redirection code, redirecting each domain to a different file on my server.
The problem is that because each website needs different meta tags, i don't know how to impliment this in the initial index redirection file.
Am worried that the search engines are not going to pick up my websites because the exact meta for them won't be on the index redirection file.
Can anyone help?
Thanks
<html>
<head>
<title>Redirect Script with JavaScript</title>
<script language=javascript>
var whois=location+" "
if (whois.indexOf("yourdomain.com")!= -1)
{ window.location ="page1.html" }
if (whois.indexOf("www.yourdomain.com")!= -1)
{ window.location ="page1.html" }
if (whois.indexOf("yourotherdomain.com")!= -1)
{ window.location ="page2.html" }
if (whois.indexOf("www.yourotherdomain.com")!= -1)
{ window.location ="page2.html" }
if (whois.indexOf("subdomain1.yourdomain.com")!= -1)
{ window.location ="page3.html" }
if (whois.indexOf("subdomain2.yourdomain.com")!= -1)
{ window.location ="page4.html" }
</script>
</head>
<body>
</body>
</html>
I want to host various websites on this same server package, so i have been told i should make an index file with html redirection code, redirecting each domain to a different file on my server.
Uhhh...no. Don't do that. It's a horrible idea. And your instincts are right, you will probably have problems with the search engines.
Use virtual domains. A good web server (like Apache, which most hosts run) can handle numerous domains on the same server. You should be able to set up each domain with its own site/directory/folder.
I could explain how to do it with Apache configuration files, but I doubt you have access to those directly. What will happen in your case is that changes you specify in your control panel will edit those configuration files in a more user-friendly fashion :)