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.