Last active
April 8, 2022 04:03
-
-
Save byjujohn/5508233 to your computer and use it in GitHub Desktop.
Magento: Programatically add custom URL Rewriting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('MAGENTO', realpath(dirname(__FILE__))); | |
ini_set('memory_limit', '32M'); | |
set_time_limit (0); | |
require_once MAGENTO . '/app/Mage.php'; | |
Mage::app(); | |
Mage::getModel('core/url_rewrite')->setIsSystem(0)->setOptions('RP')->setIdPath('Imported-Old-Website-URL-test1')->setTargetPath('alicia-suspender-skirt-32360')->setRequestPath('SHOPONLINE.aspx?Product=Alicia Skirt&Brand=Lascivious Test&PID=1975')->save(); | |
Mage::getModel('core/url_rewrite')->setIsSystem(0)->setOptions('RP')->setIdPath('Imported-Old-Website-URL-test2')->setTargetPath('alicia-suspender-skirt-32360')->setRequestPath('SHOPONLINE.aspx?Product=Alicia Skirt&Brand=Lascivious Test&PID=1975')->save(); | |
/* | |
Mage::getModel('core/url_rewrite') | |
->setIsSystem(0) | |
->setStoreId($storeId) | |
->setOptions('RP') | |
->setIdPath('index.php?cat=c' . $categoryId . '_' . $this->strip($data['name']) . '.html') | |
->setTargetPath($categoryModel->getUrlPath() . '.html') | |
->setRequestPath('index.php?cat=c' . $categoryId . '_' . $this->strip($data['name']) . '.html') | |
->save(); | |
*/ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SHOPONLINE.aspx?