Web Development

Web Development Tips & Tricks, the things that you don’t want to figure out.





Archive for the ‘SEO

What’s new in ’08?

Tuesday, January 15th, 2008

The new thing is Social Marketing, and StomperNet says it best. It’s been building up for a few years and now it’s time to take advantage.

This video has changed my world, and many others in the area: Going Natural 2.0. I am not getting paid to advertise these guys, not in the last (that would be fun), but that video has been the cause of revolution in my thinking and marketing ideas.

More Social Marketing posts will be coming up, but right now that video should get you started. While I don’t believe this replaces SEO in the least, I do think it VERY much changes the game.

-Kerry

Dynamic Content and Static URLs

Saturday, April 14th, 2007

SEO at its best!

Search engines will look at Dynamic pages as their own pages (with their own query strings), and index them as such. The advantage to having a Static URL is you can use keywords in the title which well help with your SEO. For instance, if you had an article about global warming, you might want the name to be “http://www.yoursite.com/global-warming.php”. But you don’t want to have to actually create a static page for each of those URLs.

There are two ways of doing this, one better than the other. What I had been doing for a long time is make a static page, then including the dynamic page and passing variables to it. Something like:

<?php
$articleid = 27;
include(“dynamic-page.php”);
?>

The dynamic page is coded to take that variable and then it displays the page. This is definitely better then redoing the code every page, but it can be improved.

.htaccess is the key to this solution. It can only be used on Apache servers as far as I know (sorry to those of you who have a Windows Server). Regular Expressions are also used in .htaccess, and will be in this example. The basis of this solution is you use .htaccess to redirect static links to a dynamic page, but when you redirect the links address doesn’t change. Here’s an example of how you can do that (put this code in your .htaccess file).

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)-a-([0-9]*).php$ /dynamic-page.php?articleid=$2 [L]

Ok, basically says any link to .php that ends with “-a-” (number) “.php” will be sent to your dynamic page, with the query string “articleid=” (number). So, lets say you went to “global-warming-a-27.php” it would redirect the page to “/dynamic-page.php?articleid=27″. Now your page can use that ID to call the right article from the database or wherever you’re storing the article.

That’s it! It’s as simple as that. This will allow you to create static urls, so Search Engines can find them and people can book mark them, but you don’t have to create any extra code.

-Kerry

Site Maps (Free Script)

Thursday, March 8th, 2007

All praise the glory of sitemaps!

A sitemap can be two things. There is the sitemap page that you see on someone’s website, which can be just some unordered lists or indenting, maybe a touch of CSS (Apple Sitemap), or you can do a little more with it (Download.com Sitemap). You can be completely original and make something really cool, like Websites in a Flash Sitemap. These show you all or the majority of pages on a website, and it is sometimes easier to navigate with them.

Then there is the xml sitemap that helps your SEO. These pages are a bit more complex and have a strict protocol which must be followed. Sitemaps.org goes over this protocol with detail, probably more than you need, if you plan on creating them by hand (I’ll go over other methods below). These sitemaps show crawlers what other pages there are on a site and helps them get indexed, as long as they are in the correct format. It can also tell Google other information, like it’s priority in relation to your other files.

You should submit your sitemap to search engines, obviously the largest being Google. Part of the webmaster tools (an issue for another blog) includes checking out your sitemap and making sure it can be read ok. If you want to submit your sitemap to Google, go ahead and click here. There are two methods that I know to create your sitemap xml file (other than hand coding, and who wants to do that these days?):

  1. Use a website to scan and create your sitemap xml file.
  2. Use a program to create them.

I tried and online website, and I don’t remember why I didn’t use the file, but I ended up with a downloaded program and loved it, so I stuck with it. Here’s a site if you want to try one: http://www.sitemapspal.com/.

The program I got is called GSiteCrawler. If you’ve noticed I’m mainly centered around Google, though I do suggest you put some time to get your sites listed in other search engines, the main ones at least.

Here’s the home page for GSiteCrawler: http://gsitecrawler.com/. This program has a lot of added functionality, you can choose what type of files you want it to pickup, you can exclude files, it has an ftp program so it will automatically upload your sitemap file to your site, you can set it on auto so it will do it periodically, it will help you sign up with the Google and Yahoo tools you submit your sitemap, it will create statistics and much more. The biggest thing is it’s free, and I’m one of those annoying frugal types and hate to buy anything I don’t have to, and I still hold there is a free program that is as good or nearly as good for any paid program (prove me wrong, I dare you).

Now, onto what prompted me to write this post. I’ve always been annoyed by any script or any page where you have to update something twice. If you change one thing, then it should change everything else relevant. Poor programming shows otherwise, if you don’t use includes and you add a page onto your site, you have to go through every page of your site and add another link to your nav bar, and that’s just annoying.

My point being, you shouldn’t have to update your xml file and your sitemap file every time a page changes. Well, how would you fix this? You have to get one to change the other or be based on the other (it reads it and generates a page). I’m sure there are scripts like this out there already, and I just couldn’t find them, but I decided to make my own. I’ve spent pretty much the last 6 hours on it, way too long I know, but I wanted to get out all the bugs and I wanted it to handle all situations.

Realize, if you have a special sitemap like the Websites in a Flash one above, this won’t work. The sitemap xml file has very little data for you to be creative with, all it contains is the link location, possibly the priority of the files, the frequency it was updated, and possibly the last time you modified the page. That’s not much info to move the links around, categorize them, etc., with a automated script. The only real way to separate them is by their link names and the folders they’re in, and then you can use css and do all sorts of things (like you could make a separate div with a box for each folder, and the links are in that div).

Well, I managed to create that script. Right now it can create your sitemap off of two pieces of information, the link to your sitemap and your website link, and voila, it will create it all for you. It automatically gets the name of each file in relation to it’s file name, for example. If you have a page “about-us.php” it will turn it into “About Us”. Right now this only works for -s, but it also has the ability to rename files and folders of your choice. You can say that you want “aboutus.php” to display “About Our Company” or anything else, same with folders.

Here’s the site I was working on: http://www.viewyourrights.com/sitemap.php. If you’re interested in the script and would like to check it out, leave me a comment with your e-mail and I can send you the files. I’ll also help you with changing the structure of it if you want (using CSS to make it look cooler).

Catch ya on the flip side,
Kerry