WP_Redirect()

WordPress has a handy function, wp_redirect(), for sending a user to a different page. It’s an easier way to handle redirects than to invoce the header() function on your own.

To do a 301 redirect, it’s as simple as this:

wp_redirect('http://www.example.com/', 301);

Just make sure that the function is called before any output is sent to the browser, otherwise you will get a “headers already sent” error.

It’s a bit easier than the normal way to go about redirecting:

header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.example.com/");

The 301-type redirect means that the URL that the request is being forwarded to is the “real” URL, and that the client should recognize that. A 302, the default for both methods, is less preferable, designating a “temporary” redirect. Generally you should use a 301.

Changes at Envato: Meet Tuts+

Envato, the ever-interesting network run by Collis and Cyan Ta’eed, has revamped their TUTS websites. NETTUTS, PSDTUTS, and their kin are now housed under the name of “Tuts+,” with a central website at Tutsplus.com. They’re the same sites, but more tightly-knit. Today across the…

WP125 1.3.0 Released

The WordPress 125×125 ad management plugin has just got better, with yet another release. Version 1.3.0 fixes a few bugs, and adds some useful new features. New features in 1.3.0: iCalendar subscription – Want to keep tabs on ad expirations better? Subscribe to them…

Google Canonical URLs

Finally, the solution for our duplicate content worries is over! Google now supports a new method to specify a canonical URL for your page. This “hint” suggests that Google use this page as the original, and ignore duplicates elsewhere on your domain. You simply…

PHP Serialize() Function

Arrays certainly are useful. If you’re dealing with associative data, there’s no better tool for the job. Sometimes, you’ll run into cases where it would be useful to store an entire array in a field in a database. It’s not something you want to…

BlogBuzz February 14, 2009

Yahoo Monetizes Yahoo BOSS

Yahoo is currently readying the next major update to it’s BOSS Search API. With it they will bring access to SearchMonkey data, optional longer abstracts, and greater flexibility for monetization. They will also be tracking API usage, and charging nominally for monthly usage greater…

PHP Str_Replace() Function

Have you ever wanted to take a string and replace every occurance of a substring with something else? Regular Expression voodoo is what first comes to mind for a lot of PHP developers. But there is an easier way that just happens to be…

Compete.com: Compare Your Site With the Competition

Have you ever wondered how your site stacks up against its competitors? Most people don’t make their traffic stats available to the general public, though doing so can attract advertisers… That’s what Compete.com is for. They use some secret methods to estimate site traffic,…

Defending Your Blog’s Copyright

ProBlogger has a new guest post up, by Gary from DevOracles.com, on how to stop scrapers from profiting from your work. The article explains how to write Cease and Decist letters and DMCA takedown notices, and who to send them to. The post recommends…