BigCommerce - Hosted Ecommerce Software by Interspire

Interspire Forum

 
Go Back   Interspire Forum > Interspire Shopping Cart Community Forum > E-Commerce and Selling Online

Reply
 
Thread Tools Display Modes
  #1  
Old 08-26-2013, 11:33 PM
daniloras
Guest
 
Posts: n/a
Default SEO Category - Not URL

Hello today I have a site that the categories I can not transform the name to URL friendly.

For an application made ​​on a corporate website to get the categories generated on site, but the URL link does not work, any help to solve this problem.

Link Generate ECommerce - OK:

http://www.loja.com.br/loja/categori...3%A3o-da-pele/

Link Generate Site Corporate - Not Ok
http://www.loja.com.br/loja/categori...E7%E3o-da-pele

Function PHP

HTML Code:
<?php
echo "LINK OK - CATEGORY - ECOMMERCE";
echo "http://www.loja.com.br/loja/categories/Anti%252dSepsia-e-Desinfeccao/anti%252ds%C3%A9ptico-para-degerma%C3%A7%C3%A3o-da-pele/";

echo "LINK NOT OK - WEBSITE CORPORATE";
echo "http://www.loja.com.br/loja/categories/Anti%252dSepsia-e-Desinfeccao/anti%252ds%E9ptico-para-degerma%E7%E3o-da-pele";

function MakeURLSafe($val) {
    $val = str_replace("-", "%2d", $val);
    $val = str_replace("+", "%2b", $val);
    $val = str_replace("+", "%2b", $val);
    $val = str_replace("/", "{47}", $val);
    $val = urlencode($val);
    $val = str_replace("+", "-", $val);
    return $val;
}

$listar_categoria = listar_tabela("shop_categories WHERE catparentid = 0 ORDER BY catname ASC ");
$d = new ArrayIterator($listar_categoria);

echo "<ul>";

while ($d->valid()):
    $listagem = $d->current();

    $categoria = MakeURLSafe($listagem['catname']);

    $categoria_URL = "http://www.loja.com.br/loja/categories/" . $categoria;

    echo "<li>";
    echo "<a href='";
    echo $categoria_URL;
    echo "'>";
    echo $listagem['catname'];
    echo "</a>";

    $contagem = contagemRegistrosParametro("shop_categories", "catparentid", $listagem['categoryid']);

    if ($contagem >= 1) {

        $listar_subcategoria = listar_tabela("shop_categories WHERE catparentid = $listagem[categoryid] ORDER BY catname ASC ");

        echo "<ul>";

        foreach ($listar_subcategoria as $sub) {

            $categoria_URL_1 = MakeURLSafe($listagem['catname']);
            $subcategoria_URL_2 = MakeURLSafe($sub['catname']);

            $subcategoria_URL_oficial = "http://www.loja.com.br/loja/categories/" . $categoria_URL_1 . "/" . $subcategoria_URL_2;


            echo "<li>";
            echo "<a href='";
            echo $subcategoria_URL_oficial;
            echo "'>";
            echo $sub['catname'];
            echo "</a>";
            echo "</li>";
        }
        echo "</ul>";
    }

    echo "</li>";

    $d->next();
endwhile;

echo "</ul>";
?>

Last edited by daniloras; 08-27-2013 at 10:00 AM..
Reply With Quote
  #2  
Old 03-21-2017, 12:35 PM
mendietaip mendietaip is offline
Junior Member
 
Join Date: Mar 2017
Posts: 1
Default

Make a 301 of this url to a friendly url.
Reply With Quote
  #3  
Old 03-22-2017, 12:58 AM
myshop + myshop is offline
Interspire Customer
 
Join Date: Aug 2008
Location: Central Coast, NSW Australia
Posts: 1,337
Default

Interspire Shopping Cart creates non RFC compliant URL's. its a big issue if your migrating an ISC site to another platform because creating redirects for these non compliant URL's isnt always possible.
__________________
Thanks
David
Reply With Quote
  #4  
Old 04-11-2017, 04:37 PM
anaariasip anaariasip is offline
Junior Member
 
Join Date: Apr 2017
Posts: 1
Default

Yep 301 to new URL and try to not write strange characters in URLS
Reply With Quote
  #5  
Old 04-12-2017, 03:54 AM
myshop + myshop is offline
Interspire Customer
 
Join Date: Aug 2008
Location: Central Coast, NSW Australia
Posts: 1,337
Default

Not helpful at all. If they ALREADY have URLs that are not redirect friendly, then there isnt a whole lot they can do about it.
__________________
Thanks
David
Reply With Quote
Reply

Tags
category, seo

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump