Support » Fixing WordPress » Moved site to root dir but still links to old site

  • I recently moved my site from my test location to the root folder of the server to go live with it. Now the site is viewable but once you click on any of the menu links it will link to the old site.

    The website is rathangangaa.ie and the old site is rathangangaa.ie/test/wordpress/

    I have gone in through phpmyadmin and changed the settings there to point to the new site and this seems to correct it till someone logs in to the site. Once someone logs in to the site the address in General revert back to being the …/test/wordpress/ site. Then everything on the site links to the old site.

    I dont understand how logging in can cause this to pull the old site when everything seems fine just browsing the site without logging in.

    Anyone any suggestions please?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Say you made all the necessary changes in your database? Updating the paths and everything? Yous should maybe doublecheck that, because it seems something is still with the old address in there.

    Also, have a look at the .htaccess file, so there are no redirections or rules to the old address.

    Check wp-config.php aswell, just in case.

    Thread Starter Bolt82

    (@bolt82)

    Can you point out where the htaccess file is please? I have looked for it through my ftp client and through my hosts file server (turned on “Show hidden files in both cases) and could not find it. Since i cant find it i reckon maybe that is where the problem probably lies.

    And yes i went through my database yesterday and did not find too many links to the old site but what i did find i changed.

    For updating the paths and links in the database I’d suggest you use Notepad++ (it’s free and open source), you have a very smart Search and Replace function that would help.

    the .htaccess for the whole installation file is in the root directory, public_html

    If you can’t see any htaccess file even after turning on “Show hidden files in both cases” you should probably talk with your hosting provider.

    I still think there could be something that you’ve missed in the database though.

    If I look at the page source of your blog I get this: <link rel="stylesheet" type="text/css" media="all" href="http://rathangangaa.ie/test/wordpress/wp-content/themes/twentyten/style.css" />

    Wich means that you’re still on the old address and that you need to change this in your database.

    Thread Starter Bolt82

    (@bolt82)

    Thanks i was just looking in to how to do a “Search and Replace” in my database. Im running phpMyAdmin – 2.11.0 with MySQL client version: 4.1.15 if thats any use? Does phpMyAdmin have a function for this do you know?

    Thread Starter Bolt82

    (@bolt82)

    Regarding the post you said im still on the old address thats because at the moment i have logged in to the dashboard and as i mentioned that always sends the site back to the old one. I have changed these settings in both the General part of settings in dashboard and also in the database. But once i log in to the dashboard again it pulls back the old site and the settings are reset to the old site

    Search and replace with phpmyadmin: http://gregrickaby.com/2011/05/how-to-do-a-find-and-replace-with-phpmyadmin.html

    If I was to do it, I’d do this (although could be another easier solution)

    1. export your database (.sql)
    2. Create a new user and database
    3. open the exported .sql file with Notepad++ and replace everything that needs to be replaced (paths, users, database)
    4. Upload it back, in the new database
    5. Copy the entire wordpress installation (rathangangaa.ie/test/wordpress) in the root directory (public_html), but make sure you copy only the content of the wordpress directory (everything that’s inside wordpress/)
    6. Update user and database in wp-config.

    Try it up.

    Thread Starter Bolt82

    (@bolt82)

    Ok i have attempted the search and replace thing and it didnt work. It still trying to pull from old site. Not only that its also messed up the site a bit too now haha.

    Would doing it your way still work or is it too late for that now?

    Not sure, Bolt. It really depends on more than one thing. Always back-up. After that you may wanna try what I said too.

    Before anything, make sure in your admin dahsboard – settings – general, you have the right address and not the old one.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Moved site to root dir but still links to old site’ is closed to new replies.