Re: Duplicitni indexace domeny od Google

From: LZ <coder (zavinac)>
Date: 14. 07. 2004, 09:10 CEST
> Presmerovani pomoci 303 se mi jevi jako vyhovujici. Bohuzel zvladam pouze
obycejene presmerovani na jinou > domenu. Presmerovani v ramci jedne domeny mi
nefunguje. Chtel bych proto timto poprosit nekoho ze clenu > > konference,
zda-li by mi neporadil jak by mel tento skript vypadat (treba i na soukromy
email).

ak sa jedna o skripty v PHP, staci na uvod kazdej stranky doplnit
nasledovny subor

<script language="php">

$_basic = 'www.example.com';

$server =& $_SERVER['SERVER_NAME'];
$script =& $_SERVER['SCRIPT_NAME'];

$doc = pathinfo($script);
$end = strcmp($doc['basename'],'index.php') != 0 ? $doc['basename'] : '';
$url = sprintf('http://%s%s/%s',$_basic,$doc['dirname'],$end);

if(!strcmp($_basic,$server)==0):
 header('HTTP/1.1 301 Moved Permanently');
 header('Location: '.$url);
 header('Connection: close');
endif;

</script>

s pouzitim ASP je postup velmi podobny

<%

...

Response.Status = "301 Moved Permanently"
Response.addheader "Location", "http://www.example.com/"
Response.End

%>


LZ [www.pirix.biz]
Received on Wed, 14 Jul 2004 09:10:53 +0200

This archive was generated by hypermail 2.1.8 : 14. 07. 2004, 09:09 CEST