• I’m setting up a new website, and it’s a basic cPanel environment. To keep things organized, I moved the primary domain into a subdirectory, and used some rewrite magic to run the website out of the subdirectory. Everything works (as far as I can tell), except one thing, and I’m wondering why.

    Normally I don’t leave the login link on the website, and I just type /wp-admin into the address bar when I want to login, but when I do this the redirect_to param in both the address bar and hidden form field are incorrect, and I can’t get past the login screen.

    So, for clarification, the website is installed at /public_html/domain.com, and the redirect_to attribute shows domain.com/domain.com/…

    Yes, I have made sure the site_url and home values are correct. I’ve also searched the entire database for hints, but haven’t found anything.

    I should probably mention that when I ran the WP installer it showed domain.com/domain.com as the site_url and home values, but changing them worked nicely.

    This isn’t mission critical, but I’m curious as to what’s the problem. Any clues?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Tim Nash

    (@tnash)

    Spam hunter

    Do you have some sort of caching, or server redirects in place that might be causing the issue. Also have you cleared your own cookies having done the changes?

    Thread Starter skunkbad

    (@skunkbad)

    No caching. No plugins. No server redirects. Clearing cookies doesn’t help. Changing browsers or computers doesn’t help. WP is creating this URL when redirecting to the login form, verified by the net panel of Firebug.

    The only thing I could do was to alter the login redirect, but this isn’t ideal:

    function my_login_redirect( $redirect_to, $request, $user ) {
    	return str_replace(
    		'mydomain.com/mydomain.com',
    		'mydomain.com',
    		$redirect_to
    	);
    }
    
    add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );

    I am not familiar enough with the WP core to debug this issue, which is sad because I’ve been working with PHP since 2006. I just find the code too hard to follow. I’d like to see what is deciding to create the login redirect the way it is, ya know?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Login form on /wp-admin VS /wp-login.php’ is closed to new replies.