Archive

Posts Tagged ‘database’

A Little Baby Pool

Monday, June 15, 2009 - 9:45 PM by Joe No comments

Over the weekend I got together with Andrew to make the baby pool spreadsheet. You know that traditional thing where everyone bets on the date and time of birth, weight and length of the baby. Once it was done I really wanted to make it a website for people to just come and enter in the spots they wanted and their guesses, especially since some family is far away and it would be hard to keep faxing/mailing them an update piece of paper.

I buckled down this weekend and most of the night tonight and started coding the pool. It was really tough in the beginning for me because I don’t know any how to write to MySQL databases using CGI or PHP, I really only know ASP which I can’t use since I’m on a Linux server. Sorry for all the techno-jargon, it’s almost over. So I spent many hours learning and testing writing with PHP and MySQL to get this thing to work. I eventually got it to work and then of course figured out easier ways to code it, after it was all done. Let’s just say I took the brute force method in the beginning instead of being logical and doing loops. I guess my programming classes did me well after all to notice such silly mistakes and correct them.

The point of this post? Just to let you know that I learned how to do something and the end result came out pretty great. Check out the pool here. I’m thinking over the summer I can clean up the code even more and get it working so you can click on the square you want and just enter in the information instead of using the form. This will let me create some good super bowl pools.

Changing Wordpress Blog Domain Name and URL

Monday, December 22, 2008 - 9:51 PM by Joe No comments

Not sure if the average reader would notice this, but the domain name and URL has changed of the blog. Don’t worry, all the old links will still copy over to the exact posts with the new domain.

So here’s the change:
http://www.josephhannigan.com/blog2
is now
http://www.joeandjamie.com/blog

Update your links – www.joeandjamie.com

This is something that always has bugged me since day one. I don’t know what took me so long to do this, would have been much faster if I had done it when I had three posts and a small database.

Over the next week you may experience different looks of the blog. I will be testing some new themes. Quite frankly I have grown board with this one. I did put a lot of work into making it what it is though, I remember all the long nights tweaking the page code.

Since this was a bit of a daunting task (more me worrying about screwing it up more than anything), I want to share the articles I found that were very helpful.

http://codex.wordpress.org/Moving_WordPress -This article is hands down the most important. It is narrowed down to each specific type of move you could be doing. Whether you are changing subdirectories or servers, this is the document for you.

http://codex.wordpress.org/Changing_The_Site_URL – This article goes deeper with the database changes to be made. I found it just as easy to backup the database, edit it in a good text editor (not notepad) to update the links, then restore it.

http://codex.wordpress.org/Backing_Up_Your_Database

http://codex.wordpress.org/Restoring_Your_Database_From_Backup
The trickiest part was figuring out how not to lose the old links. I am sure most will drop from the search engines, but I do have a handful of direct links which I didn’t want to lose. I found documents on .htaccess redirect rules which did the trick. The following site from Apache has all the mod aliases you can use. The RedirectMatch worked best for me.

http://httpd.apache.org/docs/2.0/mod/mod_alias.html

This is the code that I have in my old blog’s folder .htaccess file.

RedirectMatch 301 ^/blog2/(.*)$ http://www.joeandjamie.com/blog/$1

This keeps everything after www.joeandjamie.com/blog/ and puts it after www.joeandjamie.com/blog/ essentially pointing all old links to the new URLs, which is exactly what I wanted! I couldn’t be any happier.

Another important step was getting the image URLs updated. This wasn’t done during any other step because they are part of the content in the post. I very luckily stumbled across a wonderful plugin to take care of this for me.

http://www.velvetblues.com/web-development-blog/wordpress-plugin-update-urls/ – This plugin allows you to enter the old URL and the new one and presto-magico its done…I wish everything were that simple…

I learned a bunch of neat stuff tonight. Feel free to ask any questions and I’ll try my best to help.