0

I want to migrate my e-store to Magento from Cubecart.

The domain will remain the same. www.example.com

But i want to keep my Google Rankings at least for the most popular URLS.

I try to fix this using Magento URL Rewrite tool. But when i try i face two problems.

1) I inserted a new URL Rewrite rule but i think that when i reindexed URL Rewrites from Index Management everything lost. (not sure).

2) When i insert "something" to request path it works ok. But when i insert "?something" (query string) it does not redirect!

Am i have to enable query strings for magento somehow? If i enable query strings then i will loose all my SEO friendly URLS?

Thanks in advance

2 Answers 2

1

I inserted a new URL Rewrite rule but i think that when i reindexed URL Rewrites from Index Management everything lost. (not sure).

Yes... no... but. The Url-Rewrite table is refreshed. Afaik this means, that all urls with type is_system=1 might be deleted. All non-system url rewrites are not deleted. So just mark your rewrites as is_system = 0 and everything should stay were it is.

When i insert "something" to request path it works ok. But when i insert "?something" (query string) it does not redirect!

I didn't dig deep into it, but it looks like it should work with query parameters.

\Mage_Core_Model_Url_Rewrite::rewrite
[...]
$queryString = $this->_getQueryString(); // Query params in request, matching "path + query" has more priority
if ($queryString) {
    $requestCases[] = $requestPath . $origSlash . '?' . $queryString;
    $requestCases[] = $requestPath . $altSlash . '?' . $queryString;
}

$requestCases[] = $requestPath . $origSlash;
$requestCases[] = $requestPath . $altSlash;
$this->loadByRequestPath($requestCases);

[...]
$this->_getResource()->loadByRequestPath($this, $path);

\Mage_Core_Model_Resource_Url_Rewrite::loadByRequestPath
$pathBind = array();
foreach ($path as $key => $url) {
    $pathBind['path' . $key] = $url;
}
// Form select
$adapter = $this->_getReadAdapter();
$select  = $adapter->select()
    ->from($this->getMainTable())
    ->where('request_path IN (:' . implode(', :', array_flip($pathBind)) . ')')
    ->where('store_id IN(?)', array(Mage_Core_Model_App::ADMIN_STORE_ID, (int)$object->getStoreId()));

So theoretically I see no reason why query parameters shouldn't be rewritten.

0

The 301 redirect is your friend here. When importing data keep track of your old URL and tie them together with your new URLS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.