Question: i have a magento site main domain.

i did the following steps :

```
1.Downloaded the full magento site from main domain(mydomain.com)
2.Created a sub domain as new.mydomain.com(in plesk)
3.Uploaded the full magento site in to sub domain.
4.Created new database and imported the database.
5.Changed the secure url and unsecure url as 'http://www.new.mydomain.com/' in core_config_table.
6.Changed the local.xml file with new database details.

```

The above steps i did.

Then i take the sub domain as new.mydomain.com in browser, but it goes to main domain(mydomain.com).

What is the reason for that?

I contacted the client, the client give me the information that, there is no server problem. It is in your code.

So what is the problem here?

Is there is any redirection to main domain from sub domain?

Or is there is any file taken from main domain instead of sub domain?

How can i solve this?

Are there any additional steps here i need to do?

I already checked the index.php page:

Here, i give an echo statement before `Mage::run($mageRunCode, $mageRunType);`
that is :

`echo "test";
die();
Mage::run($mageRunCode, $mageRunType`

Then the `test` will be displayed.

So when running `mage` it redirects to main domain.

Answer: 
fwiw: magento stores the "domain" information in at least two records in the core\_config\_data table:

mysql> select \* from core\_config\_data where value like '%mydomain.com/';
+-----------+---------+----------+-----------------------+----------------------+
| config\_id | scope | scope\_id | path | value |
+-----------+---------+----------+-----------------------+----------------------+
| 4 | default | 0 | web/unsecure/base\_url | <http://mydomain.com/> |
| 5 | default | 0 | web/secure/base\_url | <http://mydomain.com/> |
| 1488 | stores | 2 | web/unsecure/base\_url | <http://mydomain.com/> |
| 1489 | stores | 2 | web/secure/base\_url | <http://mydomain.com/> |
+-----------+---------+----------+-----------------------+----------------------+

Before making the backup of the database, or even after backing it up, but before attempting to make the new site live, run an update statement:

update core\_config\_data set value = '<http://mynewdomain.com>' where value = '<http://mydomain.com>'

And then the site should come up fine.

Another method is to change the secure and the unsecure urls in the System->Configuration->web section and then saving the database.

SS
Have you clean cache ? ( removing /var/cache dir ) ?

You can try by phpmyadmin searching for mydomain.com in all the database and change it.