by Ben on September 25, 2008 – 8:26 am
The HTTP 301 status code is meant for use when you want to redirect a page or URL to its new destination after reorganizing or moving a web site around. This can be on the same domain or an entirely new domain. Here is the W3C definition of the 301 code.
The requested resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs. Clients with link editing capabilities ought to automatically re-link references to the Request-URI to one or more of the new references returned by the server, where possible. This response is cacheable unless indicated otherwise.
The new permanent URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s).
If the 301 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.
W3C Hypertext Transfer Protocol
This is particularly useful for search engines like Google, which will carry over page rank to the new page if this status code is seen. If you do not need to indicate permanent displacement, you can accomplish redirection by setting a Location header in PHP. The location header does the actual redirection to the new location, and can be used by itself.
If you set the Location header by itself, PHP automatically sets the status code to HTTP/1.1 302 Found.
Note, if you attempt to send headers after content has been sent, you will get a warning like, “Warning: Cannot modify header information - headers already sent by …”. Watch out for empty lines and spaces between PHP open and close tags.
Here is the code to do this in PHP…
<?php
// Permanent redirection
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.example.com/");
exit();
?>
Just make sure you put these lines in your page before any other content is sent out. The http://www.example.com/ part can be changed to whatever the new address for this resource is.
by Ben on September 24, 2008 – 10:24 am
If you have ever contacted Apple for support on any of their products, you know the first question they are going to ask you is… “What is your serial number?”. The serial number is easy to find on most of their products because they allow you to access it through the software. This is typically a much better alternative to turning the device off to flip it over, remove the battery and squint to read the long string of letters and number in a size 4 font.
The only problem is that each device OS has a different location to find this serial number. This article explains how to find the serial number in your iPhone device. It will also work for the iPhone 3G since they use the same operating system. And it should also work the same for the iPod Touch.
- From the main screen on your iPhone/iPod Touch, tap the “Settings” icon.
- On the Settings screen, tap the General section.
- Now tap the About section.
- Scroll down a ways and you will see an item for “Serial Number”. That’s it, read that off to the support person and you’ll be on your way.
by Ben on September 23, 2008 – 5:51 pm
If you have previously disabled the Mac OS X Spotlight feature and you now find that you would like to turn it on again, following these steps to do so.
- Launch Terminal and type the following command:
sudo nano /etc/hostconfig
- Find the following entry in the hostconfig file:
SPOTLIGHT=-NO-
- Change
SPOTLIGHT=-NO- to SPOTLIGHT=-YES-
- Save /etc/hostconfig by hitting Control-O and the return key. Next hit Control-X to exit the nano editor.
- Disable the Spotlight index by typing the following in the Terminal:
sudo mdutil -i on /
- When you reboot, Spotlight will be enabled again.
If you would like to disable the Mac OS X Spotlight feature, follow our guide on How To Completely Disable Mac OS X Spotlight.
by Ben on September 23, 2008 – 5:46 pm
One of the primary features of the Mac OS X operating system is their search feature called Spotlight. Many Mac OS X users depend on this great feature but others don’t find it necessary. For those of you who don’t find it necessary, it can improve the performance of your Mac OS X system if you disable it.
To do this, follow these simple steps.
Note that some other Mac OS X features and programs are based on Spotlight’s search abilities, therefore some applications could behave abnormally if you disable Spotlight, particularly in search functions.
Important: These instructions were created based on Mac OS X 10.5 Leopard. They may work on previous or future versions of OS X but they may not.
- Launch Terminal and type the following command:
sudo nano /etc/hostconfig
- Find the following entry in the hostconfig file:
SPOTLIGHT=-YES-
- Change
SPOTLIGHT=-YES- to SPOTLIGHT=-NO-
- Save /etc/hostconfig by hitting Control-O and the return key. Next hit Control-X to exit the nano editor.
- Disable the Spotlight index by typing the following in the Terminal:
sudo mdutil -i off /
- To erase the current Spotlight index, type: sudo
mdutil -E /
- When you reboot, Spotlight will be completely disabled.
If you find a need for Spotlight later, follow our guide on How To Re-enable Mac OS X Spotlight.
by Ben on September 19, 2008 – 1:10 pm
Gina Trapani, the founding editor and lead blogger for Lifehacker, the popular site that offers “tech tricks, tips and downloads for getting things done,” offers her secrets for writing a successful to-do list.
There are lots of ways you can make a to-do list into something that actually gets done. Often when people get to the point when they are writing it, they are doing a brain dump. They just have to just get things down on paper. But to get to the point where you’re checking things off, you want to make it a do-able to-do list. Things need to be as easy for yourself to do as possible. So you have to break things down into tasks. We sabotage ourselves by writing down things like “Plan the anniversary party” or “Learn French.” Those are projects, not tasks and don’t belong on your to-do list.
Read The Full Article
by Ben on September 19, 2008 – 7:35 am
Apple doesn’t typically rush the release of a product. That is something that most Apple product fans appreciate as a good alternative to the Microsoft model of service pack 1, 2, 3, etc.
However, when the iPhone 2.0 software update was released, it was done prematurely. There were a large number of complaints that came out with the release of this software update (which was included in the new iPhone 3G model). In fact, there were a lot of new bugs in 2.0 on features that were there in 1.x already. Basically, they had messed these features up. And the highly anticipated third party app support was very difficult to work with since those apps had a tendency to take forever to install and crashed frequently.
Apple finally got it right by releasing their iPhone 2.1 software update. If you have an iPhone and have not updated to this version, do it now! It does take that long and you’ll feel like you got a new and improved iPhone instantly.
Here is a summary of what the 2.1 update includes:
- Decrease in call set-up failures and dropped calls
- Significantly better battery life for most users
- Dramatically reduced time to backup to iTunes
- Improved email reliability, notably fetching email from POP and Exchange accounts
- Faster installation of 3rd party applications
- Fixed bugs causing hangs and crashes for users with lots of third party applications
- Improved performance in text messaging
- Faster loading and searching of contacts
- Improved accuracy of the 3G signal strength display
- Repeat alert up to two additional times for incoming text messages
- Option to wipe data after ten failed passcode attempts
- Genius playlist creation
by Ben on September 18, 2008 – 7:37 pm
Here are a couple thoughts from Jason Fried about things they’ve learned at 37Signals. Very simple but brilliant principles to follow…
Momentum - Has its hands in just about everything and is incredibly important. Esp for morale. Most typical projects are really exciting at the beginning and then people tend to lose interest and fade out. Long projects eat at you and you’re not even looking to do good stuff you just want to finish things and they don’t turn out well. Create a situation where projects are short and there’s excitement and it’s a short 2 week project and it leaves people in excited mode. Break big projects into as many small projects. 2 week rule.
Planning is Vastly Overrated - 37Signals doesn’t do road maps, specs, projections. They have rough ideas internally but these aren’t shared externally. Even internally they’re not set in stone or written down. Think about what’s being done now and maybe what’s next. You set expectations too soon and things changed. Don’t want to be boxed into decisions you made 18 years ago. They don’t do design docs and functional specs ‘artifacts’ that don’t push back enough. A spec doc contains 1000 yes’es. Leads to an illusion of agreement. Everyone can read the same paragraph and think you agree. Don’t do projections like financial projections.
Interruption is the enemy of productivity - when Jason and DHH were across the pond from each other they were super productive and they did work. When DHH moved to Chicago they got a lot less done. Proximity invites collaboration. Interruptions: tap on the shoulder with a question, required meetings, shouting someone’s name, “Hey Check this out”, phones & blackberry’s. Great quote: “Average work day has been traded in for work moments.” Most people get work done in the mornings or late at night. Not that there’s more work today - just that there’s less time in the daytime. Fragmented day is not a productive day. Strategy: on Thursdays nobody talks to each other. Passive collaboration instead of active collaboration. If someone is busy they can put it aside and come to it when they’re ready. Interruption points screw your days up.
Jason Fried - Things We’ve Learned At 37Signals
by Ben on August 1, 2008 – 11:06 pm
I came across this new app available now for the iPhone. It is the Wordpress app. It allows for your to read and write blog posts to your Wordpress blogs directly from your iPhone.
This post is actually being written from my iPhone 3G.
Also, one of the key features that I already like about this app, other than it’s simplicity, is how you can setup multiple blogs to manage and it will save the settings for each.
You should definitely downlaod this app if you are an iPhone and Wordpress user.
by Ben on July 10, 2008 – 4:40 pm
If you are planning to upgrade to a new Apple iPhone 3G anytime soon, you are probably thinking, “what am I going to do with my first generation iPhone?” We’ll whether you give it to a friend or family member or decide to sell it on ebay, you are going to need to reset the content and settings to their defaults so the new user can make it their own.
This is a simple task (like most things on the iPhone). Just follow these steps:
1. Make sure you sync your iPhone one last time so you have all of your content backed up to your computer.
2. On the iPhone, go to the Settings -> General -> Reset menu.
3. You’ll see the option to “Erase All Content and Settings”, select this option and confirm. This will do exactly what it says and remove all of the content (music, movies, pics, email, sms, etc) from your iPhone and set all of the settings back to their defaults.
by Ben on June 23, 2008 – 1:03 pm
A local DNS host file can be very useful when working in a development environment. You can have a development environment and a production environment and simply point the host to the development environment on your machine while all of the other users are directed to the production environment. This allows you to work on the development environment and fully test prior to pushing the changes to the live production environment.
This is a fairly common practice but if you’ve never done it on Mac OS X, then you probably need a hint as to how to do this.
The Hard Way
Step 1: Open up a Terminal windows (this is in your Applications/Utilites folder by default)
Step 2: Enter the following command to open the local host file. (Note: The sudo command requires an admin password to allow you to open this file as root.)
$ sudo vi /etc/hosts
Step 3: Now you can edit the host file. To add a new host entry, on it’s own line enter it in the format:
IP Address Host
0.0.0.0 example.domain.com
Step 4: Save the changes to your host file by pressing SHIFT + Z twice in vi.
As soon as you save this file the changes you made will take effect. To check the changes, you can ping the host you entered to see if it returns the correct address or just go to that host in a browser and see if your development environment opens instead of the production.