Moved Drupal 7 site to a different server, can'

2019-03-25 03: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 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.

7条回答
SAY GOODBYE
2楼-- · 2019-03-25 04:05

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

查看更多
相关推荐>>
3楼-- · 2019-03-25 04:09

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)

查看更多
别忘想泡老子
4楼-- · 2019-03-25 04:13

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';
查看更多
唯我独甜
5楼-- · 2019-03-25 04:19

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

查看更多
迷人小祖宗
6楼-- · 2019-03-25 04:21

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

查看更多
走好不送
7楼-- · 2019-03-25 04:26

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.

查看更多
登录 后发表回答