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

前端 未结 7 1542
醉酒成梦
醉酒成梦 2021-02-13 15:32

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 change

相关标签:
7条回答
  • 2021-02-13 15:55

    In my case the issue was solved only after refreshing .htaccess file in drupal root folder. You can take the source here: https://github.com/drupal/drupal/blob/7.x/.htaccess

    0 讨论(0)
  • 2021-02-13 15:55

    seddonym's comment about mod_rewrite led me to a slightly different solution. I was having the same problem but was able to solve it by copying the file rewrite.load from /etc/apache2/mods-available to /etc/apache2/mods-enabled.

    I think the files in mods-enabled are some sort of link files (I am novice at linux still) but copying the files worked just fine. Maybe someone will come along and tell us the proper way to do this.

    0 讨论(0)
  • 2021-02-13 16:06

    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';
    
    0 讨论(0)
  • 2021-02-13 16:06

    Sometimes all you need is to clear the cookies for the domain/website - it's possible you have old cookies alive that are causing this.

    Get a cookie manager to help simplify this, e.g.:

    Edit This Cookie (for Chrome)

    0 讨论(0)
  • 2021-02-13 16:07

    Other answer might be that rewrite php module is not installed, to do that do the followings:

    sudo a2enmod rewrite

    Restart apache2

    sudo service apache2 restart

    0 讨论(0)
  • 2021-02-13 16:13

    In my case it was very stupid, on my page.tpl.php, there wasn't any "content" and the page--user.tpl.php didn't get read. Only had the line to show content in the page.tpl.php

    Although that it is unlikely that you're as stupid as me. ;) Maybe it will be helpful anyway.

    Arne

    0 讨论(0)
提交回复
热议问题