• I’m currently running WordPress 3.0.3 and with versions 3.1, 3.1.1 and 3.1.2 (current version), it kicks me out and makes me re-login every time I click on one of the page buttons or if I search within posts, comments and a few other places:

    I’ve just noticed that on version 3.0.3, if I hover over the Page 2 link in the Posts page to get to the second page of posts, this is the link it sends me to and it works just fine: (https://www.in.gov/visitindiana/outdoorsblog/blog/wp-admin/edit.php?paged=2 )

    On version 3.1, 3.1.1 and 3.1.2, here is the link it sends me to (and it then kicks me out to re-login:
    (https://192.1.1.1/visitindiana/outdoorsblog/blog/wp-admin/edit.php?paged=2)

    I’m wondering if the 3.1 and beyond versions could be keying off the host or server ip parameters in the HTTP header. Since this comes through via the IN.gov proxy servers, they see my server as 192.1.1.1.

    Did WordPress change it to pull the host name instead of a static entry in 3.1 and higher versions? If so, is there any way for me to fix this? The site itself runs just fine for consumers, but on my back end, I have to re-login every time I page through posts, pages, comments, users (or do a search within wp-admin for any of those things either).

    Can anyone help?

Viewing 15 replies - 1 through 15 (of 16 total)
  • Hi, do you have the following line in your wp-config.php (maybe from relocating some time in the past …

    define('RELOCATE',true);

    Thread Starter standonlytofall

    (@standonlytofall)

    No, but I do have this at the bottom of my wp-config.php file:

    /** WordPress absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');
    ?>

    Does that help at all?

    Also, I host another WP blog on 1&1 which runs on Apache and I have no problems. However I manage several blogs on this domain which is an IIS environment and am having the problems here

    As far as I got it, you relocated your blog recently (march?). Does that relocation correlate to the beginning of the problems?

    What’s in siteurl and home (the two URLs in settings/general)?
    Are there any plugins running? Maybe one of them is not yet compatible to 3.1.
    Do you have a fancy .htaccess, sorry web.config stuff?

    The problem is surely, that you login at https://www.in.gov/… and the browser saves the cookie, then the link is to the ip address. The browser says: “No way, you won’t get this cookie, the other guy named ‘www.in.gov/…’ created.” and you have to log in again, because there’s no cookie from your IP.

    The login url is with the server name or the ip? And you can use all the other links in admin just fine?

    Thread Starter standonlytofall

    (@standonlytofall)

    Actually, I did relocate that blog in April, just to test out moving the blog to its own folder. Honestly, that blog is just for testing purposes, the real blogs I’m having the problems with are ../visitindiana/blog/ and ../visitindiana/techcorner/. Those have been hosted in the same place for more than 2 years.

    For ../blog/ my site URL and home are both (https://www.in.gov/visitindiana/blog) and for ../techcorner/ my site URL and home are both (https://www.in.gov/visitindiana/techcorner).

    I’ve already tried removing all plugins and the issue still happens.
    I login at in.gov/../wp-login.php and it works just fine and I don’t have problems with typical navigation within the admin section, it’s really just searching and paging.

    Where would the web.config file be located? Is it on the server root directory or would I have one within my subdirectory somewhere?

    (by the way, thanks for your help – this has been frustrating!)

    You’re welcome.

    So the problem exists only in list view in the admin panel?
    And there, it is only paging? When you edit a post, it works just fine?

    And how’s paging with comments?

    It might be a problem with WP_List_Table. The class is new with 3.1 … and it’s actually doing the search box and the pagination for most lists in the backend. When I’m at home tonight (I’m currently on the road), I’ll have a look into the code.

    P.S.: That will take me another one or two hours (to get home), but I’m quite sure, we’ll find a workaround. It might be a weakness in WP_List_Tables, but maybe there’s a reason for that (not a bug but a feature).

    Are you able to create a .php (maybe test.php) file with the following content, call it from your browser and tell me, what you see under HTTP_HOST? It would be interesting to see, if there’s your IP or your “real” hostname.

    <?php phpinfo(); ?>

    And please delete that file immediately after doing the test!

    Thread Starter standonlytofall

    (@standonlytofall)

    Yes, the problem only exists within the Admin panel and only when I’m paging through or running a search in comments, posts, pages, users, media.

    I’ve not noticed any other issues.

    Sounds like this WP_List_Table might be the issue since I wasn’t having any problems pre-3.1

    I ran the test script and in short, I’m running PHP 5.3.2

    Doesn’t php 5.3.2 give you the HTTP_HOST?

    btw: I’m at home, fed and ready to look into that.

    Thread Starter standonlytofall

    (@standonlytofall)

    Yes, it shows the IP address that my blog ends up redirecting to when paging through or running a search in comments, posts, pages, users, media

    Ok, if you feel like adventure, you can try the following:

    Look for the file at wp-admin/includes/class-wp-list-table.php (and make a backup of the file) and replace the following line:

    $current_url = ( is_ssl() ? 'https://' : 'https://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

    with

    $current_url = ( is_ssl() ? 'https://' : 'https://' ) . parse_url(get_home_url(), PHP_URL_HOST) . $_SERVER['REQUEST_URI'];

    There should be two occurrences. I don’t have a blog in a sub directory (and I don’t have the time to set up one), so I didn’t test it with sub-directory Blogs but with my domain, it works just fine.

    But beware of two things:

    First: This fix is quick an dirty (kind of) and I’m trying to find out if there will be a real fix.
    Second: As long as there is no real fix, the next update may break this workaround.

    It’ll be great, if you can give it a test drive and tell me/us, if it worked.

    Thread Starter standonlytofall

    (@standonlytofall)

    That fixed my issue for paging through posts, but I still get kicked out during searches

    Have you changed both occurrences in the file?

    Thread Starter standonlytofall

    (@standonlytofall)

    Yes, I just changed both occurences and it’s still giving me problems with searching…

    I don’t get that. The form action should be empty, so that the browser usually calls the existing url (and before you search you see the domain name in the address, right?).

    Anyway, you could workaround that by replacing the following line in wp-admin/edit.php:

    <form id="posts-filter" action="" method="get">

    with

    <form id="posts-filter" action="<?php echo ( is_ssl() ? 'https://' : 'https://' ) . parse_url(get_home_url(), PHP_URL_HOST) . $_SERVER['REQUEST_URI'];?>" method="get">

    But I really don’t get why it happens in the first place. The paging was pretty clear, but that …

    Thread Starter standonlytofall

    (@standonlytofall)

    Thanks for the help! I’m home from work for the weekend and don’t have access to the server outside the office, so I’ll try your latest suggestion next week. I’ll let you know how it goes!

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘IP Redirect Issue in WP 3.1, 3.1.1, 3.1.2’ is closed to new replies.