I've got this problem where the wordpress site will throw up a 404 if the wp-login.php has an ampersand appended after it (e.g. session expired argument).

I've changed themes, disabled all plugins, renamed .htaccess to .htaccess1 and I still get a 404.

It looks like wp-login.php is not linking the "&" after it e.g "wp-login&whatever=blah".

I also have another problem if the "redirect_to" has a colon in it e.g. "redirect_to=http://blah.com/" it will result in a 404 too. If you remove the colon, you just get the login page.

So I suspect both issues are related and its not encoding the url properly? So it sees theses symbols as programing syntax.

I don't code in php so I need some help on what code and where to put it to ensure when WP loads a page it ensures the url its fed is encode properly...

Any help grately appreciated.


Why dont you use add_query_arg to get login url,

$arr_params = array( 'foo' => 'bar', 'baz' => 'tiny' );
echo add_query_arg( $arr_params ,wp_login_url());

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.