문제

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

도움이 되었습니까?

해결책

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.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top