''); if( $p_wurl['0'] == 'blogs') { $cix = $_REQUEST['cix'] ='category'; include "config_blogs.php"; } if( $p_url[1] == 'tag') { $cix = $_REQUEST['cix'] ='tags'; include "config_blogs.php"; } if( $p_wurl['0'] == 'tv' || substr($p_url['1'],0,3) == 'tv-' || $p_wurl['0'] == 'media') { include 'lib/o_tv.php'; $cix = $_REQUEST['cix'] ='tvvideo'; } $blog_id =''; if ( $p_url[1] != '') $blog_id= getdn($p_url[1], 'post_name','blogs','post_id'); // if ($_REQUEST['cix'] == '' ) { /* //echo $_SERVER['REMOTE_ADDR']; if ($_SERVER['REMOTE_ADDR'] != '2.82.28.226' ){ //&& empty($blog_id) ) { header('HTTP/1.0 503 Service Unavailable'); die(); } */ if (!$error410) { if ( !empty($blog_id) ){ if ( $p_url[2] != '') { header("HTTP/1.1 301 Moved Permanently"); header("Location: https://amaneira.com/".$p_url[1]. '/'); } $cix = 'blogs'; include "config_blogs.php"; } elseif ( $p_url[2] != '') { $blog_id= getdn($p_url[2], 'post_name','blogs','post_id'); if ( ! empty($blog_id) ){ header("HTTP/1.1 301 Moved Permanently"); header("Location: https://amaneira.com/".$p_url[2]. '/'); die(); } } } if (isset($ixquery)) $cix2 = "catpesq"; if(!isset($sortpesquisa)) if (!isset($cix) ){ //$p_url =preg_split("/\//", $_SERVER['REQUEST_URI']); //if (BASE_URI !=="") $indice = count(preg_split("/\//", BASE_URI) ); //else $indice = 1; //echo "string $indice"; if ( substr($p_url[$indice],0,3) == "en_" ) { $lang = 4; $p_url[$indice] = substr($p_url[$indice],3); } if ( substr($p_url[$indice],0,3) == "fr_" ) { $lang = 5; $p_url[$indice] = substr($p_url[$indice],3); } switch($p_url[$indice]) { case "agenda": $cix = "agenda"; break; case "galeira": $cix = "zzz"; break; case "guia-de-compras": $cix = 16600; $_REQUEST['uix'] ='16594'; $uix ='16594'; break; case "contacte-nos": $cix = 16595; $_REQUEST['uix'] ='16595'; $uix ='16595'; break; case "pp-cv": $cix = 16598; $_REQUEST['uix'] ='16598'; $uix ='16598'; break; case "acessorios": $cix = 16599; $_REQUEST['uix'] ='16599'; $uix ='16599'; break; case "brinquedos": $cix = 16592; $_REQUEST['uix'] ='16592'; $uix ='16592'; break; case "loja_online": $cix = 16704; $_REQUEST['uix'] ='1'; $uix ='1'; break; case "contatos": $cix = 16721; $_REQUEST['uix'] ='1'; $uix ='1'; break; case "Newsletter": case "newsletter": $cix='15160' ; break; } if ($cix == "" && $p_url[$indice] != "" ){ $p_url[$indice] = str_replace('-',' ',$p_url[$indice]); $p_url[$indice] = str_replace('_',' ',$p_url[$indice]); $cix = getd($p_url[$indice],"lower(designacao)","item","coditem"); if ($cix == "" ) $cix = getd($p_url[$indice],"pag=1 and lower(titulo)","conteudo","coditem"); } $menu_seo= $p_url[$indice]; if ($cix != "" ) $seof = ""; else { $p_url2 =preg_split("/\_/",$p_url[$indice]); switch($p_url2[1]) { //case "localizacao": $cix = 209; break; //case "qualidade": $cix = 212; break; default: $cix = getd($p_url2[1],"lower(designacao)","item","coditem"); } if ($cix != "" ) $seof = ""; $menu_seo= $p_url2[1]; } } //$p_url[1] != '' || $p_url[2] switch($seof){ case "robots": gera_robots(); break; case "404": header("HTTP/1.0 404 Not Found"); $cix='p404'; default: } if (isset($ixquery)) $cix = "catpesq"; # pagina / função n encontrada if ($_SERVER['REQUEST_URI'] != '/' ) if ( $p_url[$indice] != '' && empty($cix)!== false ) header("HTTP/1.0 404 Not Found"); include "main.php"; function gera_robots(){ $CAMINHO= "http://".$_SERVER['HTTP_HOST'].str_replace("/robots.txt","/",$_SERVER['REQUEST_URI']); header('Content-type: text/plain'); echo 'User-agent: *\nDisallow: /db/adm.php\n\nSitemap: ',$CAMINHO,'sitemap.php\n'; exit; } ?>