WordPress.org

Ready to get started?Download WordPress

Forums

Help with Localhost (8 posts)

  1. nicolerazek
    Member
    Posted 1 year ago #

    I did a dumb dumb thing. I was running my site: localhost/ctrgroup off of mamp when I realized I typed the site in wrong. I changed the name of the site to localhost/ctrgrp. Now I cannot get to my site and I don't know what to do!!

    Please help!!

    Nicole

  2. vtxyzzy
    Member
    Posted 1 year ago #

    Where did you change the URL? If you changed it in Admin->Settings->General, you may be able to just rename the 'ctrgroup' folder under mamp to 'ctrgrp'.

  3. cdukes
    Member
    Posted 1 year ago #

    You can export the DB, do a find and replace, the reimport the DB.

  4. You have several options:

    1. Login to phpMyAdmin, and manually change the "siteurl" and "home" records in the wp_options table.
    2. Open up wp-config.php, and add these lines:

    define('WP_HOME','http://your.correct.url.com/path/to/wordpress');
    define('WP_SITEURL','http://your.correct.url.com/path/to/wordpress');

    Then you may access your site. Go to admin, change back the site url on the admin page as well, then remove the above lines from your wp-config.php.

    For more options, see: http://codex.wordpress.org/Changing_The_Site_URL

  5. vtxyzzy
    Member
    Posted 1 year ago #

    @cooper dukes: A simple find and replace will not work because the urls and paths are serialized in some database records. Replacing one string with another of a different length will break the serialization.

  6. cdukes
    Member
    Posted 1 year ago #

    Hmm, can you comment on any exact issues that a find/replace would create? I've used that method to migrate 100s of sites, and have never had any issues.

    http://codex.wordpress.org/Moving_WordPress#When_Your_Domain_Name_or_URLs_Change says 'widget or theme' issues, but no anecdotes come to mind.

  7. esmi
    Forum Moderator
    Posted 1 year ago #

    Any theme or plugin using the Settings API will store data in serialized arrays. My own themes, for example, store their options in such arrays. Due to the serialization, these will be (at best) completely missed by a basic search & replace or (at worst) be totally mangled. It is an issue that we do see here from time to time on the forums.

  8. vtxyzzy
    Member
    Posted 1 year ago #

    Here is a sample option_value from a local site database:

    a:1:{s:9:"imageLogo";s:61:"http://localhost/test/wp-content/themes/minddog/images/logo.png";}

    It gives the URL for a logo. The length of the URL string is 61.

    If I replace 'localhost/test' with 'minddog.com', the length of the string changes without changing the 's:61', and the logo image will not be found.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags