Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moved Drupal 7 site to a different server, can't log in

I recently moved my Drupal 7 site to a new hosting server and I'm stuck at the login page. As soon as I try and log in, I get directed back to the same page, but the URL changes from /user to /user/1, which leads me to believe that I am actually logged in, but I'm not being forwarded to the correct page.

I tried cleaning my cache, emptying the cache tables in the DB but nothing helped.

Any ideas?

EDIT: To make things a bit more clear, I've used the specific server for various other Drupal 7 sites, so I know for a fact that the server configuration is not at fault here.

like image 266
leo.vingi Avatar asked Nov 14 '11 17:11

leo.vingi


People also ask

Is Drupal 7 outdated?

However, in February 2022, the Drupal 7 EOL date was extended again to November 2023. Going forward, there will be an annual evaluation on whether community support for Drupal 7 will be extended.


2 Answers

I suspect your $cookie_domain in /sites/default/settings.php is incorrect.

Try making it match your new domain and ensure there's a leading dot .

$cookie_domain = '.mydomain.co.uk';
like image 137
Ben Swinburne Avatar answered Oct 04 '22 20:10

Ben Swinburne


Sometimes problems relating to logging in after a site migration can be because mod_rewrite was enabled on the first machine but not the second. A simple way to test this is to use the ?q= URL format (http://site.localhost?q=user) and see if you can log in like that. If that works then you can either disable clean urls from within the Drupal interface, or enable mod rewrite in Apache.

like image 41
seddonym Avatar answered Oct 04 '22 19:10

seddonym