Monday 19 December 2011

Why I Can not login via wp-admin but same time I can login from WP-login.php

I know how it feel, like no one know the solution. You like to pay everything you have, to find out why you can not login into your wordpress from wp-admin. And if you do it will redirect to same page without showing any message. but same time you can login into your wordpress from wp-login.php.  Sometime clearing the browser’s cookies might let us login again but to be honest it’s a pain, and clearing your cookies isn’t a permanent fix and do not work everyone.

Answer is easy when you know the following two solutions.

Solution1:  At   WordPress admin–> Settings–> General Settings:

“WordPress address (URL)”  should be same as “Blog address (URL)”

Solution2:  Fixing  issue with cookies.

problem is that occasionally on our various WordPress sites the wp-admin.php URL login stops working and we can only login through wp-login.php.

What we need to do is to force WordPress to follow the correct cookie path. This can be done by adding a small line of code to the wp-config.php file located in your WordPress installation root directory.

Open up wp-config.php in your web editor and add this:

/** wp-admin login fix */
@define('ADMIN_COOKIE_PATH', '/');


If you’re unsure, it can go just before the ?> at the end of the php code like so:

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
/** wp-admin login fix */
@define('ADMIN_COOKIE_PATH', '/');
?>


Update:  Some reported WP Security Scan case this issue. Please test and confirm in comments if you are using WP Security Scan wordpress plugin.

Alternative Cron


Use this, for example, if scheduled posts are not getting published.
"this alternate method uses a redirection approach,
which makes the users browser get a redirect when the cron needs to run,
so that they come back to the site immediately while cron
continues to run in the connection they just dropped.
This method is a bit iffy sometimes, which is why it's not the default."

define('ALTERNATE_WP_CRON', true);

define('DISABLE_WP_CRON', true);

No comments:

Post a Comment