Tag Archives: Wordpress

Can you run WordPress on Windows? Sure, it works great!

Did you know that WordPress works – and works great – on Microsoft Windows? Sure, WordPress runs on top of PHP and MySQL, which are commonly thought to be related to Linux, but they work perfectly on Windows Server also. In fact, this blog post that you’re reading right now is running via WordPress on Windows, MySQL, and PHP.

Here’s a blog post by Artur at OrcsWeb showing a walk-through of installing WordPress on Windows Server.

As you can see in the post, Microsoft’s WPI (Web Platform Installer) makes it super-easy even for non-administrators.

Happy hosting!

Manually Remove the W3 Total Cache WordPress plugin

I installed the W3 Total Cache plugin last night and enabled about 1/2 of the features. Everything seemed fine initially so I left it alone. Today I went to write a post and noticed my site was down. Yikes! No idea how long it was down because no one bothered to tell me (thanks for nothing readers! :>).

Since the last thing I changed was adding the W3TC plugin, I decided to remove that. Since I couldn’t get the site to load, I had to figure out a way to do this manually. Thankfully I stumbled across this post:

http://www.tech-recipes.com/rx/36504/wordpress-manual-uninstall-of-w3-total-cache/

I followed the directions there (minus the .htaccess steps since I’m running on Windows/IIS versus Linux/Apache) then killed all the PHP and W3WP processes related to my site that were running. They kept popping up new ones so I stopped the app pool, then tried again and was able to kill them all. After that I restarted the app pool and hit the URL – all better! Yeah!

I think I’ll avoid that plugin now. :)

Change the WordPress Domain Name After Moving a Site

If you’ve recently changed domain names, or made a copy of the site (for testing, development, or any other purpose) then you need to update the domain setting in WordPress. If you don’t, then all links will point back to the old/original domain name and take you away from the new site. You may also (very likely) run into issues trying to sign in to the admin pages of the new site because of domain name mismatching from what WordPress expects.

The *best* way to change the site’s domain name setting is through the WordPress admin pages. If for some reason you can’t do that, then you can also directly edit the MySQL database. Look at the wp_options table and specifically the record(s) for option_name=’siteurl‘ or option_name=’home‘.

If you can’t access the database you can also manually override the domain setting. To do this locate the wp-config.php file which should be in the root of your WordPress site. Open the file in your favorite text editor and add the two lines below:

define('WP_HOME','http://YourDomain.com/');
define('WP_SITEURL','http://YourDomain.com/');

Obviously you should replace “YourDomain.com” with the actual domain name of the WordPress site.

Happy hosting!

Update Your WordPress Database Connection String

I recently decided to create a test/development instance of a WordPress site that I run. In part of doing this I had to deal with how to backup one MySQL database and restore it to another database. After that was done, and I copied over the content files, I had to tell WordPress where to find the new database and how to connect to it.

How is this done? Find the wp-config.php file that’s located in your WordPress site. Open that file in your favorite text editor (like WebMatrix) and look for the database connection settings, which will be near the top of the file (after a large block of comments). It should look like…

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', '*NameOfTheDatabase*');

/** MySQL database username */
define('DB_USER', '*NameOfTheDatabaseUser*');

/** MySQL database password */
define('DB_PASSWORD', '*TheDatabaseUserPassword*');

/** MySQL hostname */
define('DB_HOST', '*TheNameOfTheDatabaseServer*');

The sections are self-explanatory so just go through one line at a time and edit the fields to match the database server name, database name, username for the connection, and the password for the database user. Save the file and you should be good to load up your new WordPress site now.

Happy hosting!

WordPress: Redirect One Domain to Another

I have multiple domains pointed to certain WordPress installations that I run. Some people have setups like this and run multiple sites in their WP install. I, on the other hand though, wanted to redirect all requests for certain domains to a single domain. Basically consolidating the domains so the users all wind up on what I decide as the primary domain regardless of which domain they enter.

I first tried to do this with Redirection but that plug-in doesn’t seem to quite handle things the way I wanted.

After some stumbling around I found a setting within WP itself that does the trick – no plug-in or anything else fancy needed.

The setting to redirect WordPress URLs

What I did was change the “WordPress Address (URL)” and “Site Address (URL)” settings (boxed in red above), which are found on the Settings->General options page, to both be the primary domain name exactly as I wanted it to be. Then, presto, it auto-redirected all traffic to that domain.

Now, let me note, when I first did this, the site broke for a little while. The reason was that WP was now “looking” for things in a new location and my local browser had some old data cached. It was fine in reality (for the rest of the world) but looked broken for me. After just about two minutes, the cached data seemed to have resolved itself and everything was fine.

So, to summarize with an example, I have both www.site1.com and www.site2.com pointing to a WordPress installation. But, if WP notices the www.site2.com domain it performs a redirect and reloads the site with the www.site1.com domain as I designated.

Nice trick. I hope this tip helps.