XT Commerce SEO

Nur eine kleine Übersicht für mich zur Erinnerung, weil man ja nicht mehr so oft mit XT Commerce in Berührung kommt, aber vielleicht nützt es ja dem ein oder anderen.

Hier noch 2 Funktionen um die Content und Category Seiten auch intern umleiten zu lassen:

    function contentRedirect() {
        // Wenn wir auf ner Produkt-Info-Seite sind
        if ((basename($_SERVER['SCRIPT_NAME']) == FILENAME_CONTENT) && $_REQUEST['coID'] ){
            $RedirectionLink = xtc_href_link(FILENAME_CONTENT, 'coID='.$_GET['coID']);
            $ProductLink = str_replace(array(HTTP_SERVER,HTTPS_SERVER),'',preg_replace("/([^?]*)(?.*)/","$1",$RedirectionLink));
            $CurrentLink = preg_replace("/([^?]*)(?.*)/","$1",$_SERVER['REQUEST_URI']);
            if(strpos($ProductLink, $CurrentLink) === false) {
                header('HTTP/1.1 301 Moved Permanently' );
                header('Location: '.$RedirectionLink);
            }
        }
    }

    function categoryRedirect() {
        // Wenn wir auf ner Produkt-Info-Seite sind
        if ($_GET['cat']) {
            global $cPath;
            $RedirectionLink = xtc_href_link(FILENAME_DEFAULT, 'cPath='.$cPath);
            $ProductLink = str_replace(array(HTTP_SERVER,HTTPS_SERVER),'',preg_replace("/([^?]*)(?.*)/","$1",$RedirectionLink));
            $CurrentLink = preg_replace("/([^?]*)(?.*)/","$1",$_SERVER['REQUEST_URI']);
            if(strpos($ProductLink, $CurrentLink) === false) {
                header('HTTP/1.1 301 Moved Permanently' );
                header('Location: '.$RedirectionLink);
            }
        }
    }
Dieser Eintrag wurde veröffentlicht in SEO & SEM. Bookmarken: Permanent-Link. Kommentieren oder ein Trackback hinterlassen: Trackback-URL.

Ihr Kommentar

Ihre E-Mail wird niemals veröffentlicht oder verteilt.

Du kannst diese HTML Tags und Attribute verwenden: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>