• My problem is that I can’t get into my Site Admin after installing the newest version of wordpress 2.7, Let me give you a little over view of my setup.

    OS: Windows Vista
    IIS: Version 7
    PHP: 4.3 (Installed on IIS)
    Browser: Firefox 3.06
    Cookies: Enabled
    Firewall: Enabled
    Server: Localhost
    Database: MySQL 4.0.20a-nt

    After exploring a lot of resources and trying out a million things I just couldn’t find out why it is not allowing me to get into site admin. I tried out things like these and nothing worked…

    – Enabling Cookies, Clearing etc
    – Restarting browsers
    – Trying multiple browsers
    – Making sure sessions are enabled
    – Enabling / Disabling firewalls
    – resetting password manually from database (after md5-hashing)
    – Adding values to wp-config files
    – Making sure ABSPATH was set, ech-ing it
    – Even reinstalling the whole PHP, mySQL and wordpress a number of times

    Problem Elaborated:

    When I installed the complete blog locally, everything went well, but as soon as it comes to the login screen, and I enter the username and the random password it generated. It redirects me back to the login page without any error messages. If I am in https://localhost/mynewblog/wp-login.php and enter the admin username and password, as soon as I press the enter button, it goes to https://localhost/nadir/wp-admin/login.php and then suddenly it returns to the same page with something like this in the address bar https://localhost/mynewblog/wp-login.php?redirect_to=http%3A%2F%2Flocalhost%2mynewblog%2Fwp-admin%2Findex.php

    Also when I get redirected back to the login page, it has already registered the user at this point, because if I go back to the main page of the blog https://localhost/mynewblog/ it shows me the LOGOUT link at the lower right corner of the right panel. This means that the user is already authenticated but it’s just not going into the site admin.

    Temporary Solution:
    After digging a little deeper and debugging the whole thing by putting echo “I’m now here”; after each line I would try to figure out at which step it has a problem, I followed every ‘include’ and ‘require’ in each file in the process and then suddenly I found the step where it just allowed me to login.

    The file is => <siteroot>/admin/admin.php
    Line Number 28 or around
    Function: auth_redirect();
    I comment this and voila! I’m in the site admin!
    Now I searched out what this function did… I found the above function defined in the following file
    File: <siteroot>/wp-includes/pluggable.php
    Line: 721 or around:
    The function is this;

    function auth_redirect() {
    	// Checks if a user is logged in, if not redirects them to the login page
    
    	if ( is_ssl() || force_ssl_admin() )
    		$secure = true;
    	else
    		$secure = false;
    
    	// If https is required and request is http, redirect
    	if ( $secure && !is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) {
    		if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
    			wp_redirect(preg_replace('|^https://|', 'https://', $_SERVER['REQUEST_URI']));
    			exit();
    		} else {
    			wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
    			exit();
    		}
    	}

    I have skipped this step and have no absolute idea what this function does that caused it to take me back to the login page again and again. I’m guessing by the comments in the code that it has something to do with the http / https request!? I’ve been using a normal http connection throughout everything.

    Guys all of you out there let me know what this function does as I have already spend a whole day figuring this out its 2:30 in the morning and my head is spinning. I can’t do more searching on this. If the function was there it was there for a reason. We need to know what reason was it.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Oh! So perhaps this is the root to the problem so many of us have been having!

    https://www.ads-software.com/support/topic/229521?replies=1#post-940060

    Is the Line 28 (auth_redirect();) necessary for the program to work? If I comment this out (I assume that is where I up the // at the beginning of the line?), will the blog work?

    Oh! So perhaps this is the root to the problem so many of us have been having!

    https://www.ads-software.com/support/topic/229521?replies=1#post-940060

    Is the Line 28 (auth_redirect();) necessary for the program to work? If I comment this out (I assume that is where I up the // at the beginning of the line?), will the blog work?

    No, dangit, it didn’t work for me. I’ll watch this thread, though, and see what else develops.

    Thread Starter Nadir

    (@nadirnasir)

    Well yes commenting out means “//” before the line.

    Did you notice my current setup scenario? I am on Localhost means I’m not hosting the site on anywhere but my own computer. I’m not sure about your current scenario but I we can try to help out each other. I know is so damn frustrating

    I think this is a problem of HTTP / HTTPS requests, the function in first part tries to see if user is logged in or not.

    // Checks if a user is logged in, if not redirects them to the login page
    
    	if ( is_ssl() || force_ssl_admin() )
    		$secure = true;
    	else
    		$secure = false;

    Then in the other part is validates if the request of “login in” is coming from a non-secure connection (https://) that is… IT detects and send you back to the login page again.

    // If https is required and request is http, redirect
    	if ( $secure && !is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) {
    		if ( 0 === strpos($_SERVER['REQUEST_URI'], 'http') ) {
    			wp_redirect(preg_replace('|^https://|', 'https://', $_SERVER['REQUEST_URI']));
    			exit();
    		} else {
    			wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
    			exit();
    		}
    	}

    POSSIBLE SOLUTIONS:
    1. Make sure you are logged in: When the first time you enter the username and password (be sure you are entering right ?? I’m sure you are) then as soon as it reloads the login page, go back to the main page of your blog (home page). See in the navigation if there is LOGIN written or LOGOUT written. If there is “logout” written in the main menu, then it means your username and pssword is accepted and registered by the blog in current session.

    2. Make sure you ARE / CAN USE https:// protocol. HTTPS is secure socket layer. When you open a website using HTTPS:// for example https://www.gmail.com/ the address bar turns yellow (usually) and there is a LOCK icon. It means that all the data transferred b/w your computer and server will be encrypted / secure, it increases the security level of data transfer. This https protocol requires SSL support on your server, my local system does not have SSL because you have to buy it from authentic SSL Certificate Providers (search it). Make sure your server / wherever its installed have the SSL support.

    Let me know what happened.

    Yes, I saw where yours is localhost. My domain is hosted by Dreamhost. The site that has the most problem with this is in a sub folder (mysite.com/blog) vs in the main. Recently, I tried yet another possible fix. It has been relatively stable. I get the log in page sometimes once I am in the admin section but I close the browser tab, go do something else, and come back later with no problems.

    Anyway, the possible fix was to rename the plugin folder (from /wp-content/plugins to /wp-content/plugins2). I was able to log in! Then I renamed the plugin folder back. I had to re-activate all the plugins.

    Yes, I can view https pages, if that is your question.

    As to the login or logout showing, sometimes it did, sometimes it didn’t.

    Hi;

    Please check a line in “wp-config.php” it placed root WPMU folder.
    If you see :

    define(‘PATH_CURRENT_SITE’, ” );

    change it define(‘PATH_CURRENT_SITE’, ‘/’ );

    Arif

    My client and I had been both experiencing this problem, from different computers using Firefox, Chrome, and Internet Explorer, but I had one computer on which it was not happening. I finally realised that using lazy shortcuts appears to be the problem.

    Here’s what was happening:

    I would access the admin panel by clicking in my browser’s URL field and typing the first few letters of the domain name, and then the browser pops up a list of sites I’ve visited that match. In this example, to reach my site domain.com I would type dom and the browser would show a list of sites I’ve been to that start with dom. One of these would be:
    https://domain.com/wp-admin, which I would select.

    The login screen would be loaded. If I look at the browser’s URL field now, the following URL is shown:

    https://www.domain.com/wp-login.php?redirect_to=http%3A%2F%2Fdomain.com%2Fwp-admin%2F

    WordPress knows that on my settings page, the site is at https://www.domain.com/, but because I entered the address to wp-admin without the www, it plans to redirect me to that URL once I have logged in. Not an unreasonable thing to do.

    However, the address with www knows that I am logged in, but the address without the www does not know that I am logged in, and because I am trying to access an admin page, it sends me back to the login screen. if I edit the URL to add the www, it shows me the dashboard.

    I don’t have the problem if I pay attention to the URLs I am using. When accessing admin areas, always use the www, or never use the www, but don’t mix the two in one session.

    (I would imagine that one could add redirects to one’s htaccess file to make the system compensate for these, though I’m not inclined to bother.)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Cannot enter Site Admin after installing WordPress 2.7’ is closed to new replies.