function getCurrentCmsPage()
{
    $pageId = Mage::getBlockSingleton('cms/page')->getPage()->getIdentifier();
    return $pageId;
}

Done

2.How to filtrate Magento category collection by rank?

Sometimes you need to get a list of all categories with a particular level for a custom navigation menu. This can be done as follows:

$model = Mage::getModel('catalog/category');
$categories = $model->getCollection()
    ->addLevelFilter(2)
    ->addAttributeToSelect('*')
    ->addIsActiveFilter();

However, this is not always correct. I think I should explain why, right?

If I will enter request to a base I will get the following:

SELECT `main_table`.* FROM `catalog_category_flat_store_1` AS `main_table` WHERE (main_table.level <= 2) AND (is_active = '1')

It is very obvious that condition <= is in use, which doesn't fit, because filtering categories of 3 rd level we will also get categories with the 2nd level.

Due to this we should filter in the following way:

$categories = $model->getCollection()
    ->addAttributeToFilter('level', 2)
    ->addAttributeToSelect('*')
    ->addIsActiveFilter();

After this we can do whatever we want with the collection.

3. 404 error appears when entering Magento admin panel.

Sometimes migration to the other server can cause some problems such as error 404. The most frequent reason is a hosting switching. And if you want to fix it, first of all you have to commit the next query:

SET FOREIGN_KEY_CHECKS=0;
UPDATE `core_store` SET store_id = 0 WHERE code='admin';
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';
UPDATE `core_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGEDIN';
SET FOREIGN_KEY_CHECKS=1;

Next, clear your cache folder in var/cache/. If you own enterprise version or FPC has been installed - then folder /var/full_page_cache/ needs to be cleared as well. I would also recommend you to test and improve speed of your Magento store permanently - that would be a good practice as well.