Changing your WordPress URL (Fantastico Install)

If you used parts of my post on Moving and Upgrading your WordPress to change your blog’s URL (if say, for example, you were trying to take a development site live with the final URL), and something still isn’t working right, check your .htaccess and wp-config.php files—especially if you installed WordPress through Fantastico.

I recently ran into this problem on She & He Plan Weddings. I had changed the blog’s URL in phpMyAdmin, but several items were still not working (including the admin) because it was directing me back to the development URL. I checked and rechecked the WordPress settings, the database, everything. The problem was with .htaccess and wp-config.php. I didn’t install WordPress on this site—I only came in to redo the theme and make some customizations—and I’ve always used a fresh WordPress.org install instead of using host-based installers.

The first problem was with .htaccess. Somehow the .htaccess file became unwritable (whether it was intentional by the blog installer or it is some Fantastico default), and the new blog URL was not being reflected. Changing the .htaccess file from this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~ciaraine/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /~ciaraine/index.php [L]
</IfModule>

# END WordPress

to this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

solved that problem entirely. If you'll see, the first one was assuming the site's URL should be http://gator872.hostgator.com/~ciaraine/, as it was in development. The second one reflects the removal of the directory, as the final site appeared to be at a root level at http://www.sheandheplanweddings.com/.

For more information (and to prevent problems for yourself), WordPress has this guide on how to make your files have the correct permissions. If you want to leave the .htaccess file unwritable, you'll have to use the method I have outlined here.

The second problem was with the wp-config.php file, which is located in the root folder of your WordPress install. A Fantastico install includes this line:

define('WP_SITEURL', 'http://your-url-here.com');

that I have never seen on a self-installed WordPress installation. (Just to be sure, I downloaded the new WordPress 2.8.1 and checked the wp-config-sample.php file—and no, it's not in there.) This line, again, was forcing the URL to be the original http://gator872.hostgator.com/~ciaraine/ instead of the new http://www.sheandheplanweddings.com/. I set this element to read

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

but I probably could have just deleted out the line entirely as well.

I hope this post saves someone else from the hassle I just went through trying to push this site live. I think the whole experience also reinforced my habit of doing things "the long way" (by downloading WordPress and installing it myself) instead of relying on one-click installers like Fantastico. While these sort of things are good for those who are unfamiliar with installing software or for saving time, I think there is value into knowing every setting going into your install by doing it yourself.

Tags: , , , , , , , , ,

  • Fattymattybrewing

    Thanks for writing this. I searched for this type of specific answer but found your post to be the most relevant. The .htaccess info came in handy for a new WP installation I just created through a FatCow hosting purchase. The website is not completely done yet but is at http://www.besthomebrewshop.com … When I used the hosting services’ WordPress installation, I don’t think the .htaccess file was created on the intial WP install so I had to go back and create an .htaccess file for my wordpress install. I guess I am so thankful to your post here because it gave me a real source to check that the code I was inserting was correct. Cheers

  • Anonymous

    I tend to do a self-install by downloading the files from wordpress.org vs. the Fantastico install because of these sorts of problems. I do end up with a few client-performed Fantastico installs though, and that is how I find these issues. Good luck on the site!

  • http://www.fayazmiraz.com Fayaz

    Interesting, I too posted a similar solution last year: http://www.fayazmiraz.com/wordpress-blog-url-change/

    It’s also helpful if you set WP_HOME.

    define(‘WP_HOME’, ‘http://your-url-here.com‘);

    Also, I see you fell in the same pitfall I did!
    Notice in your PHP CODE for wp-config.php, your qoutes are curly one, not straight single quote, so if anyone copy your CODE, their wordpress will not work.

    I’ve posted a wordpress hack, so that straight quotes in your CODE is not automatically replaced by curly quotes: http://www.fayazmiraz.com/disable-auto-curly-quotes-in-wordpress/

    After implementing this, people will be able to copy-paste your CODE directly in their wordpress installation without a problem.

    Happy Blogging :)

  • Colin

    Thank you. You fixed my problem but I still have ‘/site’ after the URL which was the home URL before I moved it to the root. Even though it is loading the new home page which doesn’t have ‘/site’ as part of its address. (?) I’ve changed in the database and in General/ Settings.

  • http://rokureviews.org/ Roku Reviews

    that was a helpful share. thanx for sharing it