0
votes

dear sirs,

we are running a magento shop and our hosting company made us a dev environment, we want to use to upgrade the CE Version from 1.7.02 to 1.9.1. For this purpose a database was copied and the local.xml was edited correctly to connect with the test database.

But we have a problem, that the dev-subdomain (dev.domain.com) is not working. It redirects always to the live environment index.php (domain.com).

What should we do? Our hosting provider tells us the problem is in the .htaccess file in the live folder. The test environment .htaccess is empty.

My first idea:

RewriteEngine on

RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/ [R=301,L]

Should we delete it or change it somehow? If i change both links to dev.comain.com the URL while visitng the site is correct, but the redirection fails and we get an error message.

If i add

#Alternate default index page
DirectoryIndex dev

Then neither the live nor the test index.php do work. So what could we try instead or additionally? The Rewriterules are on.

############################################
## rewrite everything else to index.php

RewriteRule .* index.php [L]

Additionally we have this one in our .htaccess

############################################
## default index file

DirectoryIndex index.php

<IfModule mod_php5.c>

Just deleting or renaming the .htaccess does not work neither. It just still redirects to the live environment.

I will be thankful for every hint.

Best Regards

Dimitri Petrik

1

1 Answers

1
votes

You need to changed base URL stored in the database. Open core_config_data table and look for following rows:

web/unsecure/base_url
web/unsecure/base_link_url
web/unsecure/base_skin_url
web/unsecure/base_media_url
web/unsecure/base_js_url
web/secure/base_url
web/secure/base_link_url
web/secure/base_skin_url
web/secure/base_media_url
web/secure/base_js_url
web/cookie/cookie_path
web/cookie/cookie_domain

You probably only have to change web/unsecure/base_url and web/secure/base_url And forget about .htaccess redirect.