1

Recently I changed the url of my site from atlas.site.com to site.com, one thing I just came across in the admin area for posts, custom post types, pages, where there are more than one page of posts, the arrows for next, previous, first & last page, are all pointing at atlas.site.com/wp-admin/...

I've done a find and replace for atlas in the db, but perhaps I'm not looking in the right place, and it returned 0 results, and WP_SITEURL & WP_HOME in wp-config are both set to http://www.site.com/

The same applies for Title, Author, Date at the top of the columns for sorting.

Thanks

5
  • Are you using any sort of caching? Commented May 14, 2012 at 17:19
  • nope not yet, site is still under development Commented May 14, 2012 at 17:27
  • What function are you using for your next/previous links? Commented May 14, 2012 at 18:35
  • This is just the untouched wordpress backend, not pagination on the front end, if that's where you were heading with your question. Commented May 14, 2012 at 18:39
  • For Wordpress, you don't need to hack the codebase at all. I found the fix from this answer to work great wordpress.stackexchange.com/a/52802 Commented May 28, 2019 at 16:42

3 Answers 3

2

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'];

Thanks goes to http://www.stat.sinica.edu.tw/alvin/blog/archives/1129/ for posting this fix.

Now the question is there any way to do this without editing core files? If anyone can post that I'll mark that as the accepted answer, I haven't had to modify my core yet, and I'd prefer to keep it that way.

2
  • 1
    Please post your question about doing this w/o editing core as a new question and link back to here for context ... I definitely want to see how this can be done w/o hacking core ... Commented May 21, 2012 at 15:55
  • New question posted, wordpress.stackexchange.com/q/52801/4090 Commented May 21, 2012 at 16:56
1

Check Settings » General and make sure WordPress Address (URL) and Site Address (URL) are both set properly. Then go to Settings » Permalinks and reset your permalink structure.

Also, you should do a global find in your database, but not necessarily replace (although if you're doing a find/replace from atlas.site.com to www.site.com or site.com it should be safe). Either way, back up your database before doing any global operations.

Edit: Okay, one more idea then I'm stumped. Try the Relocate Method - add this line to wp-config.php before the "stop editing" line: define('RELOCATE',true);, go to wp-login, log in as normal, go to Settings->General, make sure both URL's are correct, save settings, then remove that line from wp-config.php.

8
  • WordPress Address (URL) and Site Address (URL): Correct, Permalinks: Reset, Global Find: Found Nothing Commented May 14, 2012 at 19:11
  • So the word 'atlas' appears nowhere in any of your files and anywhere in your database? That doesn't make any sense at all. Try doing a SQL dump, load it into Notepad++, and do a find in there, or search using phpMyAdmin (use the % wildcard on either side of 'atlas'). It has to exist in one of those 2 places (files or database) to show up at all. Commented May 14, 2012 at 21:09
  • I realize it makes no sense, and it's driving me nuts, I just did a db dump, opened it in notepad, nothing. Downloaded the entire site locally, searched every file in each directory, found one instance of atlas, and was commented out in a css file. I'm stumped. I know it has to be coming from one of these places. Commented May 15, 2012 at 20:00
  • One more thing for you to try, then I'm out of ideas. Updated my post to reflect. Commented May 15, 2012 at 20:44
  • 1
    I'm currently trying to work backwards to figure out where exactly wp is pulling this url from, will update if I have any success, thanks for your attempts. Commented May 18, 2012 at 12:29
0

Try a find/replace in the codebase. Whatever plugin is creating that custom post type may have hardcoded URLs to those assets/links.

1
  • Just searched, turned up nothing, I should have been less specific above, it actually happens for all posts & pages. Commented May 14, 2012 at 18:29

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.