Login not working after move to remote server (5 posts)

  1. Sorcol
    Posted 4 years ago #

    I’ve volunteered to make a website for a local cycling club and have just moved the site from my local (WAMP) server to remote server (Linux shared hosting).
    I'm having some problems with the live site, and though I‘ve been searching the forums for explanations/solutions I haven’t come up with much yet. I'd really appreciate any ideas you might have on what’s going on...
    (The site is my first effort with WordPress/PHP, so please do excuse newbie mistakes and mangled terminology)

    Short version:
    I’ve used a custom theme and everything is working well locally: no unexpected issues, admin area, log-in/out, plugins and redirects all fine.
    On the live site, log-in/out and page redirects are not working at all, and the WP Admin area functions but brings up white screens after most actions. Superficially the live site works okay, apart from the blank pages resulting from failed redirects.
    I think the problems are custom-theme related, as the live site seems to work fine with the Twentyten theme activated. This is strange because the custom theme works fine for me locally.

    Prior to the move to the remote server I activated the Twentyten theme and deactivated all plugins.
    After the move, with the Twentyten theme still active, I logged in to the admin area and activated my custom theme. When I logged out (all plugins still deactivated and my custom theme activated) I found I could not log back in. In order to do so, I had to change back to Twentyten via the database. Once I was logged back in (with Twentyten active) I changed back to my custom theme, remaining logged-in.

    With the custom theme activated, the following issues now arise:
    Log in/out

    1. I cannot log out – when I click the Log Out link I get a white screen and the following appears in the URL bar
    On refresh I am returned to the previous page with log-in status unchanged (logged in).

    2. If I access the site with the custom theme activated while logged-out (by using a different browser to that which I use to change theme) I can’t log in - I am returned to the page I have tried to log in from with logged-out status unchanged (no white screen this time).

    3. If I try to log in using an incorrect password, I get the following error message
    ERROR: The password you entered for the username admin is incorrect. Lost your password?
    ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.
    Cookies are enabled on both browsers I am using (Chrome 19.0.1084.52 m and Firefox 10.0.2)

    4. A friend duplicated the site on his local server and has the same log in/out issues that exist on the remote server (he could not log in).

    wp_redirect does not seem to work on the live site. I have used it two instances, ‘redirect to first child’ activated via custom field on page template and ‘redirect to post-permalink if there is only one post in the current category’. In both cases there is no error message, but no redirect happens.
    Both redirects work fine on the local server.

    White Screens
    With the custom theme activated in logged-in mode , I can access the WP Admin area. I can make changes, but I get a white screen after most actions, eg. updating a post, activating a plugin, filtering posts by category. Changes I make do take effect, despite the white screen.

    I reactivated all plugins and they seem to work fine. With all plugins deactivated, the above issues are still present.

    I'm happy to provide any further information and/or code that might help identify the problem.

  2. Mark Ratledge
    Forum Moderator
    Posted 4 years ago #

  3. Sorcol
    Posted 4 years ago #

    @songdogtech Thank-you for the very prompt response and the references. I'll go through them in detail and report back - hopefully I have just missed a step in the transfer.

  4. Sorcol
    Posted 4 years ago #

    The Login/out problem and white screens are fixed!
    There were some empty lines after the closing php tag in the custom theme's functions.php file - I deleted these and can now log in/out. No more white screens either.
    Redirect problem still to be resolved...

  5. Sorcol
    Posted 4 years ago #

    I suspect my page redirect problem was caused by inappropriate use of wp_redirect. I was using the code posted here to conditionally redirect to a page's first child. I used the code within a loop, which worked fine locally but not on the live site.

    In the end I created a new page template for pages I want to redirect. The template consists of the following code:

    <?php /* Template Name: Redirect Page */ ?>
    <?php if (have_posts()) {
      while (have_posts()) {
        $pagekids = get_pages("child_of=".$post->ID."&sort_column=menu_order");
        $firstchild = $pagekids[0];
    } ?>

Topic Closed

This topic has been closed to new replies.

About this Topic