Ajax software
Free javascripts
↑
Main Page
2.
Save the following code as
blog301fix.php
, and copy it to your
/blog/wp-content/plugins
folder:
<?php
/*
Plugin Name: Blog301Fix
Plugin URI: http://www.seoegghead.com/
Description: Redirects /blog to /.
Author: Jaimie Sirovich
Version: 1.0
Author URI: http://www.seoegghead.com/
*/
if ($_SERVER[‘REQUEST_URI’] == ‘/blog/‘) {
header(“HTTP/1.1 301 Moved Permanently”);
header(‘Location: ‘ . preg_replace(‘#blog#‘, ‘’, get_bloginfo(‘url’), 1));
exit();
}
?>
3.
Enable the plugin from the Plugins area of your admin page. Now, loading
http://
seophp.example.com/
will display your blog, and loading
http://seophp.example.com/
blog/
will 301 redirect you to
http://seophp.example.com
.
Summary
This chapter has shown you how to use as a basis for a successful blog by making some modifi-
cations and installing some plugins to the end of search engine optimization. Creating such an application
from scratch would be a task the size of — well, . Plugins are available to implement much of
the concerns discussed in this book. Therefore, using is a viable option if you decide to launch
a blog as part of your search engine marketing efforts. Please see
http://www.seoegghead.com/
seo-with-php-updates.html
for updates to this chapter, especially with regard to updated
releases.
310
Chapter 16: : Creating an SE-Friendly Blog
c16.qxd:c16 11:04 310
Ajax software
Free javascripts
→