• I worked on an intranet WP site for a client a while back and they’ve asked me to assist with some edits. I was given access to the intranet site via a special portal for external access. However, going through this external portal changes the URLs. I can get to the login screen, but when I enter valid login credentials it simply reloads the login screen again.

    I get no errors on screen or in the console… just back to the login form like nothing happened. I suspect this is somehow related to the URL for the site being a mismatch for the configured site URL.

    Any recommendations on how I might handle this situation? Is there a way to configure WP to recognize more than one URL or something?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator bcworkz

    (@bcworkz)

    An alternate, valid URL would normally automatically redirect to the configured site URL site. If that’s an intranet URL that’s invalid for you, the WP installation will need modification to prevent redirects to its configured URLs. It’s possible to dynamically set site and home URLs via PHP constants so that multiple URLs will remain valid.

    Before embarking upon that solution, there might be something easier. In some cases the login URL includes a redirect_to= query string that’s invalid. This can cause the login screen to reload. In some cases you are actually logged in and you can manually request a direct admin URL and get to it (assuming your user role is permitted there).

    If for some reason you do not get logged in at all, try requesting the log in screen without any query string at all. If these remedial attempts fail, the installation will need modification like I first mentioned.

    Thread Starter Andrew Rothman

    (@arothman)

    Before embarking upon that solution, there might be something easier. In some cases the login URL includes a redirect_to= query string that’s invalid. This can cause the login screen to reload. In some cases you are actually logged in and you can manually request a direct admin URL and get to it (assuming your user role is permitted there).

    Can you give me a bit more info on this suggestion? There is a “redirect_to” on the URL, but it’s the “real” internal URL rather than the obfuscated one I’ve got access to. If I attempt to load an internal URL (i.e. domain.com/wp-admin/edit.php?post_type=page) I still end up at the login page. If I navigate to a specific page I do see the WP admin toolbar across the top, but clicking ‘Edit’ just bounces me back to the login again.

    Moderator bcworkz

    (@bcworkz)

    You can remove any redirect_to query string that might be in place. You should especially do so if the URL is invalid from your context. Without any redirect_to directives, we’re normally taken to the admin dashboard at /wp-admin/. However, it’s possible for plugins and themes to filter this directive to take you elsewhere.

    clicking ‘Edit’ just bounces me back to the login again.

    That tells me the WP installation is not properly setup to handle external URLs like what you are forced to use. I believe WP is constantly trying to redirect you to its intranet URL/UNC, which have no meaning from your context.

    Requests from outside need to have the outside domain set as WP’s site and home URL settings like I mentioned in my last reply. You’d need proper FTP access in order to implement something like that, so you’d likely need your client’s IT staff to manage this. You can pass on this link for reference: https://developer.www.ads-software.com/advanced-administration/wordpress/wp-config/#wp-siteurl

    They need to dynamically define WP_SITEURL to match the domain you’re using. Same goes for WP_HOME as explained in the subsequent section.

    Thread Starter Andrew Rothman

    (@arothman)

    OK. I will investigate that. I won’t be able to get FTP access, but I can get on a screen share with the client and reach the WordPress back end with them to try and edit the functions file.

    Moderator bcworkz

    (@bcworkz)

    FYI the constants I mentioned earlier are typically defined in wp-config.php. It might work if defined in functions.php, but I fear it’d be too late there. wp-config.php code executes before almost anything else.

    Best of luck in your efforts.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.