• Resolved Dimu

    (@cry0nics)


    Hi,

    I recently installed a new theme. If I use as website address “siteurl/install_folder” everything works. In Settings -> General I changed from url from “siteurl/install_folder” to “siteurl/” and now login does not work anymore.

    When I press “submit” with the right credentials I get redirected to “siteurl/wp-login.php?” (with the “?” at the end).
    Without the “?” at the end is working.

    Can somehow show me how I can modify the url so that it does not add “?” anymore? ?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Cry0nicS

    I assume what you were trying to do is,
    have the wordpress files at
    https://example.com/wordpress/
    and still want the frontend to load at
    https://example.com/

    for that to happen, you still need the siteurl to point to
    https://example.com/wordpress
    and have the homeurl to point to
    https://example.com
    and make an index.php file at the folder
    https://example.com/index.php
    having content
    <?php require_once 'wordpress/index.php'; ?>

    when you do that, the login requests go to
    https://example.com/wordpress/wp-login.php

    where as your pages will be served like
    https://example.com/mypage/

    I hope it resolves your query.

    In case you’re not able to do that since you messed up the configuration and can’t even login, you can do that by editing wp-config.php and adding the following lines within the php tags

    define( 'WP_SITEURL', 'https://example.com/wordpress' );
    define( 'WP_HOME', 'https://example.com' );
    Thread Starter Dimu

    (@cry0nics)

    Thanks for your answer.
    The homeurl and siteurl at set as you mentionat above (I event checked wp_options in DB)

    Now, I have 2 index files. One in public_html and one in /wordpress. Both have the same content. This:
    define(‘WP_USE_THEMES’, true);
    require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );

    Which of the two index files do I have to change? And how?

    Cry0nicS

    change the one in the public_html folder and leave the one in wordpress folder as it is.

    Thread Starter Dimu

    (@cry0nics)

    Cry0nicS

    I just visited your site, you seem to have forgot to mention that there’s a plugin you’re using for login and registration system. Can you please mention its name so that I can be more specific about the issue you’re facing?

    Also I checked the login at this page
    https://dota2romania.com/wp-admin/

    which is working fine

    In the code, it seems the action URL is written statically, so you need to replace

    <form name="LoginWithAjax_Form" id="LoginWithAjax_Form" action="https://dota2romania.com/wp-login.php?" method="post">

    with

    <form name="LoginWithAjax_Form" id="LoginWithAjax_Form" action="https://dota2romania.com/website/wp-login.php?" method="post">

    which might be coming from an ajax login plugin you are using or might be written in theme somewhere

    even more correct way of doing it is by writing like

    <form name="LoginWithAjax_Form" id="LoginWithAjax_Form" action="<?php echo wp_login_url(); ?>" method="post">

    if that block is outside PHP tags

    Thread Starter Dimu

    (@cry0nics)

    Where do I find this above code?

    I activated a plugin for login just to test if I can change something. In the beginning it wasn’t. It is called “custom login”

    P.S. The plugin was installed from the beginning, but it was “deactivated”. I can remove it if it would help solve the issue

    Cry0nicS

    “custom login” plugin has nothing to do with it.

    I did some digging into your site and found that you’re using a pirated theme, which has a header.php with incorrect login URL written statically into it.

    So now you need to edit that pirated header.php file and replace two two lines in there,

    Replace

    <form name="LoginWithAjax_Form" id="LoginWithAjax_Form" action="<?php echo esc_url(home_url())?><?php echo (!is_plugin_active('better-wp-security/better-wp-security.php')) ? '/wp-login.php?' : '/?'; ?>" method="post">

    with

    <form name="LoginWithAjax_Form" id="LoginWithAjax_Form" action="<?php wp_login_url(); ?>" method="post">

    and

    <form name="LoginWithAjax_Form" id="LoginWithAjax_Form1" action="<?php echo esc_url(home_url())?><?php echo (!is_plugin_active('better-wp-security/better-wp-security.php')) ? '/wp-login.php?' : '/?'; ?>" method="post">

    with

    <form name="LoginWithAjax_Form" id="LoginWithAjax_Form1" action="<?php echo wp_login_url(); ?>" method="post">

    Thread Starter Dimu

    (@cry0nics)

    Thanks again for your answer.

    I did that. Now when I “sign in” it doesn’t crash anymore. But it also doesn’t login.

    (I guess it’s the same problem as by “login with steam”. It does the same, it loads the data, but does not login)

    Cry0nicS

    Now those issues are not with WordPress or any open source project, here we don’t provide support for commercial themes, try contacting the theme developer, here’s the link for your help

    https://www.skywarriorthemes.com

    Thread Starter Dimu

    (@cry0nics)

    Thank you

    Thread Starter Dimu

    (@cry0nics)

    I am pretty sure it’s something else messed up. I made a new environment on a different domain and it worked perfectly.

    I reverted the changes from above and set homeurl the same as siteurl. Now login works…

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Login redirects to "siteurl?"’ is closed to new replies.