Support » Fixing WordPress » Sortable Admin Columns have the wrong url

  • Resolved cw17s0n

    (@cw17s0n)


    I have been trying to work this out here WordPress Answers but after several attempts no luck yet.

    The issue began after changing the url from atlas.site.com to site.com, the column headers that are clickable/sortable still have atlas at the beginning of the url, I’ve done a full dump of the database and found no instance of atlas, and searched through all files and no instance of atlas, which makes absolutely no sense, so I’m hoping someone may have some other idea.

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • I would check your wp-config.php file to ensure it’s not being set there as well.

    Thread Starter cw17s0n

    (@cw17s0n)

    I have it set there also to the correct url.

    define('WP_HOME','http://www.site.com/');
    define('WP_SITEURL','http://www.site.com/');

    Can you take a screenshot or some how show us/tell us more about the “column headers that are clickable/sortable”?

    Thread Starter cw17s0n

    (@cw17s0n)

    Here is a screen shot, http://i.imgur.com/XkRDm.jpg where you see *chuck is me trying to work backwards through the core files to see if I can figure out how the url is being set, wondering now if wordpress is setting the url based on the server, since the site is still on atlas.site.com, that is the only place I can see atlas might show up.

    Thread Starter cw17s0n

    (@cw17s0n)

    Ok so apparently this site is behind a firewall or proxy.

    On lines 491 and 658 in wp-admin/includes/class-wp-list-table.php, replace this line:

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

    with

    if(!empty($_SERVER['HTTP_X_FORWARDED_HOST'])){ $hostname = $_SERVER['HTTP_X_FORWARDED_HOST']; } else { $hostname = $_SERVER['HTTP_HOST']; } $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $hostname . $_SERVER['REQUEST_URI'];

    I’ve posted a new question to see if anyone can come up with a way to do this without modifying core files.
    http://wordpress.stackexchange.com/q/52801/4090

    Maybe one of these solutions will work?

    http://codex.wordpress.org/Administration_Over_SSL

    Thread Starter cw17s0n

    (@cw17s0n)

    The solution ended up adding

    if ( ! empty( $_SERVER['HTTP_X_FORWARDED_HOST'] ) ) {
        $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
    }

    to wp-config.php

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Sortable Admin Columns have the wrong url’ is closed to new replies.