0

I am in the process of moving a drupal site to a new server. I copied the drupal db and moved all the files of the drupal installation.

The old url is http://www.sniffingmusicians.echidna-band.com/ and the new is http://www.sniffingmusicians.com/, which point to 2 different servers.

Even though the frontpage of new is there when I login it redirects me to the old domain! Additionally, all the content is prefixed with the old url. I changed the $base_url in the settings php but there is no real impact. Where else can I reconfigure my site's url?

  • 2
    Have you flushed your cache after changing the base_url? Have you modified your .htaccess file from what came with core? – schnippy Aug 24 '13 at 20:53
  • No to both. Access the clear cache page. I'll check on .htaccess – Potney Switters Aug 25 '13 at 8:49
  • Enabled rewriteon on .htacess but I still can only access the main page. For example it says that admin/modules does not exist. – Potney Switters Aug 25 '13 at 9:12
  • ok, one at a time: 1. Clear cache and check if you have any reference of URL in DB 2. Make sure clean-urls has been enabled. Until then visit the pages with '?q=' e.g. sniffingmusicians.com?q=user/login – vijaycs85 Dec 22 '14 at 13:23
1

I came up with the same error after did a server migration.

After all those try error, I just realised I didn't give apache permission to access the web folder. After added in apache config, everything works as charm

1

Maybe you can use this module:

Path Redirect (Drupal 6)

Redirect (Drupal 7)

1

Just in case someone else comes across this issue.

1) Check that the base URL is set or uncomment it in the settings.php around line 247. Mine was set to the old URL and did a www redirect.

2) Check your .htaccess file in case there are some hard coded redirects. Look for the full URL.

3) As mentioned before in the accepted answer, check permissions are correct. Some really good help here: https://www.drupal.org/node/244924

4) If you have the global redirect module enabled turn it off.

drush pm-disable globalredirect
drush cc all

or use SQL and truncate the cache tables manually:

UPDATE system SET status=0 where name='globalredirect';

5) Apparently mobile tools can also cause the redirect. https://www.drupal.org/node/1713462#comment-6312804

drush pm-disable mobile_tools
drush cc all

Or with SQL

UPDATE system SET status=0 where name='mobile_detect';

6) Secure pages can also cause the redirect. This is what it was in my case. You can set the base path variable to your new domain using either drush:

drush vset securepages_basepath 'http://example.com'
drush vset securepages_basepath_ssl 'http://example.com'
drush cc all

Or disable secure pages entirely via drush:

drush pm-disable securepages

And here via SQL and truncate the "cache_*" tables yourself:

UPDATE system SET status=0 where name='securepages';
-1

If you are using domain access, be sure to check the table PREFIX_languages. I had the exact same problem and wasted 2 days before I found the problem. The old domain was hard coded in the PREFIX_languages table and once I changed it everything worked perfectly.

  • There is no indication that the OP is using Domain. – mpdonadio May 16 '14 at 22:10
  • @MPD, please notice the word 'if'. I responded to 'Drupal redirects to old url after moving to new server', a problem I have faced several times and solved the hard way. There is no reason to down-vote a sincere answer. – Sam Timalsina Dec 14 '14 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.