Prestag0od Posted February 28, 2020 Share Posted February 28, 2020 Γνωρίζει κανείς τι πρέπει να κάνω για να κάνω redirect τα παλιά URL's των κατηγοριών - προϊόντων στα νέα μετά το Migration απο oscommerce σε prestashop? Επίσης εκτός απο το νέο sitemap XML στο google πρέπει να δηλώσω και κάπως αλλιώς πως άλλαξαν τα URL's? Γενικά τι πρέπει να κάνω για να μην χάσω ότι SEO έχει γίνει εώς τώρα; Βρήκα αυτό το Module για redirects αλλά πιστεύω πως σίγουρα υπάρχει και άλλη λύση στο θέμα αυτό.https://www.presto-changeo.com/prestashop-migration-modules/97-prestashop-oscommerce-url-redirect-module.html Link to comment Share on other sites More sharing options...
sanctusmob Posted February 29, 2020 Share Posted February 29, 2020 Υπάρχουν πολλοί τρόποι να κάνεις redirect. Αν θέλεις να το κάνεις μέσα από το presta κάνεις το εξής. Φαντάζομαι δεν έχει αλλάξει το domain... Θα φτιάξεις ένα αρχείο στο Document root του site με όνομα old_site_redirects.php με την εξής μορφή. <?php $url_redir_maps = array( '/old-category-path/2-home' => '/el/2-home', '/old-category-path/4-foo' => '/el/4-foo', '/old-category-path/5-bar' => '/el/5-bar', ); if(in_array(@$_SERVER['REQUEST_URI'], array_keys($url_redir_maps))){ header("HTTP/1.1 301 Moved Permanently"); header("Location: ".$url_redir_maps[@$_SERVER['REQUEST_URI']]); exit; } Στο array έχεις μόνο το path χωρίς το domain. Στο Document root στο αρχείο index.php θα προσθέσεις αυτή την γραμμή πάνω από το require config. require_once('old_site_redirects.php'); Δηλαδή θα γίνει έτσι /** * 2007-2018 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2018 PrestaShop SA * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ require_once('old_site_redirects.php'); require(dirname(__FILE__).'/config/config.inc.php'); Dispatcher::getInstance()->dispatch(); Link to comment Share on other sites More sharing options...
Prestag0od Posted February 29, 2020 Author Share Posted February 29, 2020 13 hours ago, sanctusmob said: Υπάρχουν πολλοί τρόποι να κάνεις redirect. Αν θέλεις να το κάνεις μέσα από το presta κάνεις το εξής. Φαντάζομαι δεν έχει αλλάξει το domain... Θα φτιάξεις ένα αρχείο στο Document root του site με όνομα old_site_redirects.php με την εξής μορφή. <?php $url_redir_maps = array( '/old-category-path/2-home' => '/el/2-home', '/old-category-path/4-foo' => '/el/4-foo', '/old-category-path/5-bar' => '/el/5-bar', ); if(in_array(@$_SERVER['REQUEST_URI'], array_keys($url_redir_maps))){ header("HTTP/1.1 301 Moved Permanently"); header("Location: ".$url_redir_maps[@$_SERVER['REQUEST_URI']]); exit; } Στο array έχεις μόνο το path χωρίς το domain. Στο Document root στο αρχείο index.php θα προσθέσεις αυτή την γραμμή πάνω από το require config. require_once('old_site_redirects.php'); Δηλαδή θα γίνει έτσι /** * 2007-2018 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/OSL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2018 PrestaShop SA * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ require_once('old_site_redirects.php'); require(dirname(__FILE__).'/config/config.inc.php'); Dispatcher::getInstance()->dispatch(); Ευχαριστώ για την συμβουλή φίλε μου. Εαν κατάλαβα καλά σε αυτό το σημείο θα προσθέσω αριστερά όλα τα παλιά URL και δίπλα τα καινούργια σωστά? '/old-category-path/2-home' => '/el/2-home', '/old-category-path/4-foo' => '/el/4-foo', '/old-category-path/5-bar' => '/el/5-bar', Κατηγορίες και προϊόντα? Έχω χιλιάδες προϊόντα στο e-shop. Υπάρxει κάποιος άλλος πιο εύκολος τρόπος? Link to comment Share on other sites More sharing options...
sanctusmob Posted March 1, 2020 Share Posted March 1, 2020 Το έχω κάνει για 50000 url... Προφανώς δεν το παράγεις το αρχείο με το χέρι. Ανάλογα σε τι μορφή έχεις τα url θα πρέπει να φτιάξεις το αρχείο με κάποιο script (bash, bat, vb, php, python) ή query αν τα έχεις σε κάποια βάση. Σε όλους τους τρόπους θα πρέπει να γίνει το mapping. Link to comment Share on other sites More sharing options...
Prestag0od Posted March 1, 2020 Author Share Posted March 1, 2020 11 hours ago, sanctusmob said: Το έχω κάνει για 50000 url... Προφανώς δεν το παράγεις το αρχείο με το χέρι. Ανάλογα σε τι μορφή έχεις τα url θα πρέπει να φτιάξεις το αρχείο με κάποιο script (bash, bat, vb, php, python) ή query αν τα έχεις σε κάποια βάση. Σε όλους τους τρόπους θα πρέπει να γίνει το mapping. Σωστό και αυτό! Μπορεί να γίνει και μέσα σε excel με CONCATENATE. Πρέπει να δω εαν ίδια τα ID μετά το mirgration. Με βάση το ID δίπλα θα βάλω την ονομασία της κατηγορίας και απο το προϊόν που θα φέρω απο την βάση δεδομένων. Έχει αρκετή δουλίτσα αλλά νομίζω πως γίνετε. Ευχαριστώ! Link to comment Share on other sites More sharing options...
sanctusmob Posted March 3, 2020 Share Posted March 3, 2020 Ναι γίνετε και με concat στο excel. Αν δεν είναι ίδια τα ID θα έχεις πρόβλημα με το skroutz (αν είσαι στο skroutz) και όχι μόνο. Link to comment Share on other sites More sharing options...
Prestag0od Posted March 3, 2020 Author Share Posted March 3, 2020 9 hours ago, sanctusmob said: Ναι γίνετε και με concat στο excel. Αν δεν είναι ίδια τα ID θα έχεις πρόβλημα με το skroutz (αν είσαι στο skroutz) και όχι μόνο. Ευτυχώς τώρα έλεγξα και έχουν το ίδιο ID. Ευχαριστώ για την βοήθεια! Link to comment Share on other sites More sharing options...
Prestag0od Posted March 26, 2020 Author Share Posted March 26, 2020 On 3/1/2020 at 10:16 AM, sanctusmob said: Το έχω κάνει για 50000 url... Προφανώς δεν το παράγεις το αρχείο με το χέρι. Ανάλογα σε τι μορφή έχεις τα url θα πρέπει να φτιάξεις το αρχείο με κάποιο script (bash, bat, vb, php, python) ή query αν τα έχεις σε κάποια βάση. Σε όλους τους τρόπους θα πρέπει να γίνει το mapping. Καλησπέρα φίλε μου. Μια ερώτηση ακόμα σχετικά. Έγραψες πως το είχες κάνει για 50.000 URL. Έχω περίπου και εγώ τόσα να βάλω μέσα στο script που μου έγραψες πιο πάνω. Επειδή αυτό γίνετε include μέσα στο index.php μήπως βαρύνει πολύ το άνοιγμα της αρχικής? Link to comment Share on other sites More sharing options...
sanctusmob Posted March 26, 2020 Share Posted March 26, 2020 Καθόλου. Link to comment Share on other sites More sharing options...
Prestag0od Posted March 26, 2020 Author Share Posted March 26, 2020 2 hours ago, sanctusmob said: Καθόλου. οκ ευχαριστώ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now