FAQ - Web Site Management

Questions on the use of the domain name, redirects, 404 error page, the problems of "duplicate content", spam and control of access on the site.

Domain name and site management

Can I redirect my domain name on a free host?

"I acquired a domain name from a registrar. What I would like is that the domain points on my free host and is the domain name that appears in the URL field of browser. "

This is a very common question. Unfortunately this is impossible and we will explain why. Of course, the registrars can redirect a domain name through a redirect 301 or 302, or through frames. In the first case it is the target URL that appears in the bar (thus the address on free host), which is indexed by search engines, in the second case the domain name is displayed, but search engines do not follow the link.
In fact the principle of redirection should not be allowed, otherwise a domain could be acquired, redirected to a site with heavy traffic whatsoever, and make profit of the content of the popular site by increasing the PageRank of the redirected domaine, and then reuse traffic obtained on the domain by linking it to its own site.
Invisible redirection is possible only when the host takes into account the DNS management.

return

How to have my own 404 error page for pages not found?

Create or complete a .htaccess file with the following content:

ErrorDocument 404 /index.html

This file should be at the root of the site, often the subdirectory "www". Archive.

The redirected of not found page can be done to a page designed for this purpose to incite to correct the link, or just to the home page. The domain name must not be included because it impedes search engines. Indeed it can replace the code page 404 by the code 200 of a normal load. Google will refuse your sitemap if a full URL with the domain name is used to redirect errors.

return

Can I point several domain names on the same site?

This is explicitly prohibited by search engines, including Google.
Your other domain names must point on different pages, and it may contain a link or 301 redirect which redirects the user to the content hosted. In both cases, search engines are aware of the redirection and this avoids they regard the two domains as attempting to trust results of searches thanks to a double indexing.

return

Can I put a page on two different sites?

The "duplicate content", is prohibited by search engines.
You can avoid sandbox applied to duplicated pages, see the SEO FAQ to the question "how exclude a page of indexing".

return

How to redirect the home page on the domain name without filename?

You can use a redirect 301 as above, except when the page in question is the default home page of the site!
In this case, we will use the PHP environment variable REQUEST_URI which indicates which page has been requested to the server. Then we use a load command, as in the following example:

<?php
 if(eregi('index.(html|php)', $_SERVER['REQUEST_URI'])) 
 { 
  header('HTTP/1.1 301 Moved Permanently'); 
  header('Location: http://www.scriptol.com/'); 
 } 
?>

We checked with the function eregi that the loaded page is index.php or index.html (or any other name) and only in such cases is made the redirection. Another option is to rename the home page, home.html for example, and define it as home page with the following command in .htaccess:

DirectoryIndex home.html
ErrorDocument 404 /home.html

return

Redirection of a domain name on a site by PHP

To redirect a domain name on a site without any condition one can use the following code in the index.php file:

<?php 
   header("Status: 301 Moved Permanently"); 
   header("Location:http://www.scriptol.com"); 
?>
For the visitor it is as if he had typed the URL of the destination site.

return

How to execute PHP 5

By placing the following command in .haccess under Apache:

SetEnv PHP_VER 5

On other UNIX servers that can be:

AddType x-mapp-php5 .php

Consult the instructions of your provider to make sure that the environment variable used is the same.

return

How to change the extension file that the server must parse for embedded PHP code?

If we put PHP code in a page with the .html extension, how to make the server processing the PHP code? By placing a command as in the next .htaccess:

AddType application/x-httpd-php .htm .html
.htm and .html are examples. The command will do that files with these extensions are handled by the server as the files with the .php extension.

return

How to protect a directory by a password?

By modifying the file .htaccess. This can be done most simply by using a tool that will automatically generate the file.

return

How to block aspirators ?

You can insert the following code in your.htaccess file.

return

How to prevent a spam site to link my site?

In the .htaccess file, add the following lines:

SetEnvIfNoCase Referer ".*(domain | anotherdomain | etc. ).*" spammer=yes      
Order allow, deny 
allow from all 
deny from env=spammer
The names of the sites, domains with extensions, are placed in a list in parentheses and separated by the vertical bar.
This code combines a code to a range of domains, and the following lines give permission to all sites except the sites designated by the code of sending visitors. For the latter access is denied.

return

Why loading of my pages is so slow?

That may depend on various factors: an ill-conceived script, a database whose requests are slow in coming, or any other cause. You can have a diagnosis of your site with this online testing site tool.

return

How to know the site of an IP address?

The IP address is a number that identifies your computer in the case of a static address, or your Internet connection in the case of a dynamic address assigned by a service provider.
It's also a number that identifies an Internet site, but the domain name is associated with that number by the DNS manager (typically the host or the registrar), which allows access to the site.
Typing "my ip" on a search engine, a site will display your IP address on the homepage.
The Ripe site provides access to the database that links the domain names to IP addresses. Simply type the IP for the domain name and know its owner.

(c) 2007-2008 Scriptol.com