Changing your Wordpress URL (Fantastico Install)

Posted on July 9, 2009

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: , , , , , , , , ,

One Response to “Changing your Wordpress URL (Fantastico Install)”

  1. Petya
    Apr 02, 2010

    ……

    Подписался на RSS



Leave a Reply


Kudos

  • I needed to capture email addresses when customers downloaded a bonus I provided for the release of a friend’s book. Nikole was not only able to complete the task perfectly, but she did it in an instant! This is only one example of the knowledge Nikole has imparted to me. She knows the ins and outs of small business web design and marketing like no one I’ve ever met! If you need any work done on your website — large or small, I can’t recommend Nikole more highly.

    - Maren Sederquist MES CSCS CPT, Owner, HealthFIT / Kidlifting

Categories