WordPress.org

Forums

Rename wp-login.php (unmaintained)
[resolved] 404 error on login page (29 posts)

  1. Rafiki
    Member
    Posted 1 year ago #

    I get a weird 404 error on my login page:

    https://www.cambridgerunning.org/crc-login/

    My .htaccess isn't writable. Could that be an issue? Here are the contents of my .htaccess:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    Should I add anything to it to get rid of the 404 error? Otherwise I think it's working fine..

    http://wordpress.org/plugins/rename-wp-login/

  2. Ella Iseulde Van Dorpe
    Member
    Plugin Author

    Posted 1 year ago #

    That's really weird. Can you log in properly?
    What other plugins do you have installed and what other customisations have you added to the login form?
    .htaccess is not the problem, the plugin doesn't use it.

  3. Rafiki
    Member
    Posted 1 year ago #

    Yup, can login properly through the desktop version. We also have a mobile version - logging in via the mobile version doesn't work. I'm using Custom Login 2.0 to make customizations to the login form - though they are only aesthetic (i.e. logo, colors, etc).

    Here is a list of plugins that I'm using that might cause an issue with the login form:

    Custom Login 2.0
    Page Security By Contexture
    WPTouch Pro
    WordPress HTTPS

  4. Ella Iseulde Van Dorpe
    Member
    Plugin Author

    Posted 1 year ago #

    It's really difficult to find out the cause without having access to it, not sure if we'll find it. I haven't tested this plugin on websites that enforce HTTPS or multisite (see description), so I can't guarantee that it would work, but atm I don't see a reason why it wouldn't on HTTPS.
    Could you deactivate and activate the plugins you mentioned one by one and look at the login form to see if it's still there?

  5. Ella Iseulde Van Dorpe
    Member
    Plugin Author

    Posted 1 year ago #

    I tested Custom Login - not the problem.
    Looked into WPTouch (the free version) and they hardcoded the link in their login form (and also their comment form!): <?php site_url(); ?>/wp-login.php. Plugins and themes should use <?php echo wp_login_url(); ?> so other plugins can hook in this function to modify it. I recommend asking them to fix it, I can't do anything about it.
    So that's your mobile problem, I'll continue looking into the 404 problem.

  6. Rafiki
    Member
    Posted 1 year ago #

    Yup- already fixed the mobile issue :)

    Thanks for looking into this!

  7. Ella Iseulde Van Dorpe
    Member
    Plugin Author

    Posted 1 year ago #

    I've already created a support ticket there http://wordpress.org/support/topic/dont-hardcode-wp-loginphp

  8. Ella Iseulde Van Dorpe
    Member
    Plugin Author

    Posted 1 year ago #

    WordPress HTTPS also has wp-login.php hardcoded twice, not sure if that's the problem. Have you tried deactivating this one yet?
    Btw, I don't recommend changing plugin files, but if you do, I'm sure you know the changes are gone next time you update.

  9. Ella Iseulde Van Dorpe
    Member
    Plugin Author

    Posted 1 year ago #

    If you can change the files, could you go to this plugin's folder (rename-wp-login) and add a line to the file wp-login.php?
    On line 151 you'll see
    } // End of login_header()
    Just before that line, add
    var_dump($wp_error);
    Then go to your login form ad you'll see some raw data under the error. Copy paste that here. Then go back to the file and remove the line you added. If you accidentally removed or added something else, delete the plugin and reinstall it.

  10. Rafiki
    Member
    Posted 1 year ago #

    Will check this out today at some point. Thanks for being on top of this. Sorry for being slow on my end!

  11. Rafiki
    Member
    Posted 1 year ago #

    I added the var_dump as you said. All I see at the top right corner is a "NULL":

    http://cambridgerunning.org/crc-login

    Probably doesn't help that much. I'll see if I can disable some of the plugins and through the process of elimination figure out if there are any culprits that may be causing the "404" error to show up.

  12. Ella Iseulde Van Dorpe
    Member
    Plugin Author

    Posted 1 year ago #

    That's really weird... Yes, update WordPress and this plugin to the latest version and try deactivating your plugins one by one and see if it's still there. It might have something to do with the fact that you use https, I still have to test the plugin for that, but I don't have the means to do that right now.

  13. Rafiki
    Member
    Posted 1 year ago #

    So I disabled plugins one by one and the 404 error is still there.

    My guess would be is that it's a server-side issue.. hence a '404 error'. The server that's hosting my site is running on IIS (yea.. I know), so perhaps it's not smart enough or not happy with the URL redirection of wp-login.php - any advice on configuring a .htaccess to make it go away? Or alternatively, should I contact my hosting company and ask them if there is anything on their end that's causing this problem?

  14. Rafiki
    Member
    Posted 1 year ago #

    So I disabled plugins one by one and the 404 error is still there. The only time it disappears is when I disable your plugin :-(

    My guess would be is that it's a server-side issue.. hence a '404 error'. The server that's hosting my site is running on IIS (yea.. I know), so perhaps it's not smart enough or not happy with the URL redirection of wp-login.php - any advice on configuring a .htaccess to make it go away? Or alternatively, should I contact my hosting company and ask them if there is anything on their end that's causing this problem?

  15. Rafiki
    Member
    Posted 1 year ago #

    I really think it's an issue with IIS to be honest.

    I have an .htaccess file with RewriteEngine On, but it does nothing since .htaccess is only used on Apache. Perhaps you can try replicating the bug on your environment without having mod_rewrite enabled on your apache configuration?

    I've contacted my hosting company - will get back to you once I hear back from them.

  16. Ella Iseulde Van Dorpe
    Member
    Plugin Author

    Posted 1 year ago #

    I really don't have any experience with IIS... But, I agree that it's definitely the issue. You have permalinks of the structure example.com/index.php/post-title/. I didn't notice that before... Have you ever tried https://www.cambridgerunning.org/index.php/crc-login/ ? Because that just works! :)
    The only problem is that all the links point to https://www.cambridgerunning.org/crc-login/ ... I'm not sure why it's necessary to have index.php there.

  17. Ella Iseulde Van Dorpe
    Member
    Plugin Author

    Posted 1 year ago #

  18. Ella Iseulde Van Dorpe
    Member
    Plugin Author

    Posted 1 year ago #

    Here's another article on IIS's website linked from the codex:
    http://www.iis.net/learn/extensions/url-rewrite-module/enabling-pretty-permalinks-in-wordpress

    Switching from "almost pretty" to "pretty" permalinks might solve your problem.

  19. Rafiki
    Member
    Posted 1 year ago #

    Yup - that makes sense.

    The index.php is used for "PATHINFO permalinks" a.k.a "Almost Pretty" permalinks. It's WordPress's alternative to "Pretty Permalinks" and is sometimes used if the web server can't handle "Pretty Permalinks" as is the case with my web server :)

    See: http://codex.wordpress.org/Using_Permalinks

    I recommend updating your plugin so it can also accommodate "PATHINFO" permalinks (i.e. using index.php for all the links). It makes sense now why cambridgerunning.org/index.php/crc-login is working vs cambridgerunning.org/crc-login is not! Also - I tried typing in 'index.php/crc-login' as the new login page, but it changes it to 'index-phpcrc-login/'!

    I'm happy to test it out on my site before you release the next version!

  20. Ella Iseulde Van Dorpe
    Member
    Plugin Author

    Posted 1 year ago #

    Allright, so you can't change to pretty permalinks, as outlined in the linked article above?
    I'll look into it, not sure how to approach this. I could check if your permalink structure starts with index.php and then add it to all the urls.

    Maybe change to Apache? :)

  21. Rafiki
    Member
    Posted 1 year ago #

    Haha yes plan is to change to Apache! But I'm sure there are other folks out there that also use the 'index.php' PATHINFO permalink structure that might have the same problem as me.

    BTW - I was able to replicate the 404 'error' by changing the permalink structure of my site to '/index.php/blog-title/'!

    While your plugin *technically* works fine - I'm thinking other folks might also run into the '404' problem. So, maybe it's worth a look to save yourself trouble down the road as it's *technically* a valid permalink structure :)

  22. Rafiki
    Member
    Posted 1 year ago #

    Thanks for all the help! Going to mark this as resolved!

  23. Ella Iseulde Van Dorpe
    Member
    Plugin Author

    Posted 1 year ago #

    Cool, I'll see what I can do this week. Could you test it on your website before I release it?

  24. Rafiki
    Member
    Posted 1 year ago #

    Yup - happy to do so!

  25. Ella Iseulde Van Dorpe
    Member
    Plugin Author

    Posted 1 year ago #

    This one should work: http://avryl.org/wp-content/uploads/2013/09/rename-wp-login.zip

    1. Instead of letting WordPress parse the request, the plugin will now parse it before WordPress gets the chance.
    2. This means you should still be able to have a login url without index.php, even if you have permalinks with that.
    3. The 404 you saw was actually WordPress adding a 404 error because it couldn't find the page after parsing the request. Since the plugin does all its things before that, this error should be gone.
    4. Now the login page should also load a few milliseconds faster!

    Let me know if it works and if it creates any other problems.

  26. Rafiki
    Member
    Posted 1 year ago #

    The link is bringing me to this page:

    https://gist.github.com/Avryl/6333070

  27. Ella Iseulde Van Dorpe
    Member
    Plugin Author

    Posted 1 year ago #

    Ah, sorry, I just removed it a few hours ago. Could you try again?

  28. Rafiki
    Member
    Posted 1 year ago #

    That fixed the 404 error! Thanks!

  29. Ella Iseulde Van Dorpe
    Member
    Plugin Author

    Posted 1 year ago #

    Awesome!

  30. Ella Iseulde Van Dorpe
    Member
    Plugin Author

    Posted 1 year ago #

    Fixed in 1.4, thanks for your help!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Rename wp-login.php (unmaintained)
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.