Archive

Posts Tagged ‘seo’

Why Not All Traffic Is Good Traffic

November 15th, 2009 admin 1 comment

Web traffic; it’s the “money-maker” for many webmasters. But is all traffic really a good thing? Well, this is a topic that isn’t quite “black and white” so to speak. Traffic can have many affects on a site, both positive and negative. Ultimately, good traffic is defined as frequent visitors, or a visitor who buys your product (if you’re selling something). Bad traffic, on the other hand, consists of mostly anything else: spam, abusers, web-surfers, etc.

We will begin by discussing the positive effects of all traffic. Having good traffic, obviously, cannot hurt you. There is no way that comes to mind that I can think of in which good traffic will hurt your site; be it resale value or otherwise (thus its name, “good” traffic). If you’re getting tons of good traffic, your site is booming, and if you ever want to sell it, that raises it’s value!

Now, bad traffic can also have some (temporarily) “positive” effects. If you’re running a site which does not worry about visitor comments spam hits and robots shouldn’t be much of a problem for you. In fact, they may make your stats look great at first glance, and you may even be able to catch a gullible buyer and convincing him or her (by not saying anything more than to look at the visitor count) that the traffic is great! However, for those serious domainers, etc. they will check those stats down to the IP’s of the visits. When they track back all those IP’s to public proxies, and known spam bots they will throw the name back in your face and your sale will fall through.

So in the end, all traffic does not quite turn into good traffic. It is indeed a great factor for any sale of a site, but visitor turn around is what really matters. So when analyzing your own traffic, check as if you were buying your site up and take steps to minimize spam traffic!

Regards,
Dennis M.

Categories: Other Tags: , , , ,

The Basics to Mod_Rewrite

May 8th, 2009 admin No comments

Mod rewrite. A term many webmasters often hear and get that awful sense of dread coming from within. But why? What makes this term strike fear in the hearts of webmasters everywhere? Misunderstanding. Yep, that’s it. People are afraid of what they don’t understand, and rightfully so when it comes to anything .htaccess; if you don’t know what you’re doing, you could waste hours of time working on something that could have taken 5 minutes.

So now that I’ve scared all of you, how can I help this dilemma? Well, I’m going to go through the barebone basics of what mod rewrite does and why one could (and probably should) use it on a production quality site.

Let’s begin talking about what it is and what people use it for. Mod_rewrite (as the prefix implies) is an Apache mod. This allows a user to make links to page (which usually don’t exist) appear to be static. Let me explain. Many PHP developers like to use the http://YOURDOMAIN.com/?p=PAGE which is fine. In fact, it’s probably the most efficient way to go about setting up multiple pages in one document. However, this is bad for SEO: which brings us to our next point. This is usually used for SEO purposes (but obviously there could be infinitely many uses) to make keep the programming aspect as http://YOURDOMAIN.com/?p=PAGE but make users (and Search Engines) see http://YOURDOMAIN.com/PAGE.html (or whatever extension for that matter).

Now how does one use mod_rewrite. Well, the code snippets I will provide will ALWAYS go in a .htaccess file for an Apache server (and some other servers actually do use .htaccess file and so it may be valid on those as well). Since this is not a tutorial about the .htaccess file, I won’t go anymore into detail on that-just realize that if you’re using an FTP client, you will have to show hidden files to see the .htaccess because the nature of Linux (any file/folder prefixed with a “.” is automatically hidden unless otherwise specified).

Now that we have that clear let’s begin with the most basic thing that we need. We must turn the mod on, and to do so we write this:

RewriteEngine On

Like I said, this will enable the mod.

Now, to do this efficiently (unless you would like to type in all the pages manually), a knowledge of regex is necessary. Regex is by no means easy, but well worth learning if you’re serious about programming in any language. A very good reference to look at is Regular-Expressions.info as a first-hand learning source and then use Google for help with more specific issues.

Now I’m going to go through a little example (I will provide the source code for at the end of this tutorial) which will explain how to create SEO friendly URL’s by way of page-NUMBER.html.

First, we need to create the page which is going to process the information. Below is a simple PHP document in which ?p=NUM will give you a result.

/**
* .htaccess Tutorial by Dennis M.
*
* This is just the example script where we will
* be redirected to and will do all our work! :)
*
*/

if(!$_GET['p']){
$_GET['p'] = “default”;
}

// Define our pages:
switch($_GET['p']){
// Default page if unknown page, etc.
default:
print “Default page!

Try:
Page1
Page2

or Page3 (Redirects back here! :D )”;
break;
case 1:
print “This is page one, congratulations! If you’re accessing this through ?p=1 then you’re not using SEO friendly
url’s. If you’re using page-1.html then you have successfully created an SEO friendly rewrite!”;
break;
case 2:
print “This is page one, congratulations! If you’re accessing this through ?p=2 then you’re not using SEO friendly
url’s. If you’re using page-2.html then you have successfully created an SEO friendly rewrite!”;
break;
}

?>

Now, below this is the .htaccess file which will properly rewrite the URL’s. They can still be accessed by ?p=NUM, but now page-NUM.html (or just .htm for that matter) will also work!

#### mod_rewrite Tutorial by Dennis M. ####
# #
# mod_rewrite .htaccess file. This is a #
# working redirect sample! A proper SEO #
# friendly rewrite. #
# #
###########################################

# Enable mod_rewrite
RewriteEngine On

# Our rules – using regex to find page number!
# the regex will find any page-NUM num being anywhere from 1
# to 99 digits in total length
#
# The regex more deeply explained here:
# http://microsonic.org/2009/05/08/the-basics-to-mod_rewritethe-basics-to-mod_rewrite
#
RewriteRule ^page-([0-9]{1,99})\.htm(l)?$ ?p=$1 [QSA,L]

Now let’s pull this apart. Obviously, RewriteRule is exactly what it stands for-what we’re going to be changing. Now the ^ and $ symbols mark the beginning of the link (^) and the end ($) [those are standard regex start/end string symbols]. This is followed by the static part of the link or page- followed by our first regex rule. The parenthesis ( and ) set this information apart as a set. Now, the brackets [ and ] set another element which is any number 0-9. The set symbols { and } allocate length of the string. For example, this will allow any number from 0 (1 digit long) to 1000 (4 digits long) all the way up to 99… carried out 99 total digits. The next part is the \. The backslash (\) escapes our . so it’s not processed as regex (because it is a regex symbol) and so it reads as part of the static text. The htm(l)? makes the htm necessary and the l character optional (allowing .htm or .html): which is the reason for the set (l) followed by the ? meaning optional. Now, the ?p=$1 is the actual page we will be going to. ?p=NUM is the format of our initial document to access pages, so we keep that and $1 takes the value of the first set in the regex defined before. In this case it is ([0-9]{1,99}) so it grabs the number. [QSA,L] are simply anchors. Now, I recommend always using [L] when rewriting URLs so it goes to your script, otherwise it will revert to the main index of your site (YOURSITE.com/index.php?p=NUM or however you choose to rewrite).

So now you all understand what misery truly is. You’ve been introduced to .htaccess and mod_rewrite. One of the most sensitive things a webmaster has to deal with otherwise you will receive a nasty “500 Internal Server Error.” So now the only thing to do is practice, practice, practice until you become as comfortable as comfortable can be with .htaccess, mod_rewrite, and regex. Good luck!

Mod_rewrite Tutorial

Regards,
Dennis M.

SEO: The Importance of Unique Content

April 27th, 2009 admin 1 comment

Too many domains today are registered and then simply setup as parked pages, or even worse: duplicates of some other big site. This is an atrocious mess. It takes all originality out of the web itself! If one is simply going to reproduce content that another site already has, the reasons to go to multiple websites are lost.

Now, many of you may try to argue: “Your blog has content that can be found elsewhere,” or the great, “Your blog isn’t original either.” Well, the fact of the matter is it’s true; my blog is not original (there are many programming blogs out there), and yes the ideas of my posts can probably be found elsewhere. However, I write my blog to address your (user’s) questions directly focusing on specific questions you may have. Now there is no doubt some of my content is completely unique, but other things (such as my last post) have been posted over and over again. Now why would I do this? Simply to give another perspective, but I digress; duplicating content with hardly any change to it’s original format is what I am talking about and that’s not how this blog operates.

When I say unique content, I don’t mean you must only cover completely unique concepts. In fact, that is not what I am saying at all as you can see by the premisis of this blog. However, you do want to make sure you thoroughly understand your topic and can completely reproduce it yourself with little or no reference (Now be reasonable with yourself. You need to learn somehow anyway, so don’t shun outside sources!). If you can reproduce content all by yourself, it’s generally unique giving your perspective on your topic. As you very well know, people learn differently, so maybe your way of explaining the topic was better than the content giants of slashdot or a site similar in nature.

From an SEO standpoint, however, unique content is very important. It’s what gets your site noticed in the web. More unique content means (generally) more backlinks which lead to more traffic. To the average person, SEO means nothing coherently, but in terms of them ever finding out about your site it means almost everything. Good SEO means it’s easier for the average person to understand navigation of your website (e.g.: using static page links and deep links) and a higher popularity rating on (sometimes) search engines and other sites.

So as you can see, unique content plays a huge role in getting your site recognized. Without a userbase, a website ends up being wasted space on the web with stuff everyone already knows or doesn’t care about. So before you write that next article, make sure you’re not just copy and pasting (for reasons other than plagarism ;) ).

Regards,
Dennis M.

Importance of RSS Feed and What it Is

April 18th, 2009 admin No comments

Well, first thing’s first. Let’s explain what RSS Feed is. RSS stands for Rich Site Summary. It basically allows a user to keep updated on their favorite sites while not actually having to go to them unless they want to read the whole article or object.

Of course, RSS feed is not available for all sites, but why is the number of sites who are using the feed increasing so rapidly? Well, from an end-user’s point of view, RSS feed is a great tool to keep them (users) interested in a website. Without compromising security (like giving your e-mail out to a mailing list then being hit with spam) or any other true commitment, one can easily get the information they need from a site at the time it is available on the site (they know when this is by checking their feed).

Also, for users who subscribe to the RSS feed, it provides more “traffic security” for the website itself. From the owner’s point of view, it makes it more difficult for a user to simply “forget” your site and never return. When a user looks at their RSS feed and sees an interesting article, they will most likely click it and read the full article; thus returning traffic to your site.

Now that we understand the concept of RSS and its importance, if you enjoy the contents of this site, please subscribe to the Microsonic RSS Feed! :) It is the large orange RSS icon in the top right of the page. Or, if you’re using FireFox, click the RSS icon by the URL and hit “Subscribe to ‘RSS 2.0-all posts’”; your efforts are much appreciated!

This has been the last article in the series listed (oh maybe 5 posts ago?) so I’ll be starting on some new topics very soon! As usual, internet related and jam-packed full of useful information! Be sure to come back and check those out if you’re interested. Or better yet, subscribe to the feed here and just keep checking that and read the articles you find useful! ;)

Regards,
Dennis M.

Categories: Other Tags: , , , , ,

What is CGI and How Can It Be Useful?

April 17th, 2009 admin 2 comments

Well, to be honest, in the present day the CGI wrapper is used much less commonly with all the new web programming languages such as: PHP, Ruby, etc. However, CGI, to put it simply, is a kind of C wrapper for websites. The concept sounds confusing and the truth is, it is just like any other programming language.

Let’s begin discussing the uses of it. The most important use of it today is for hosts that are not PHP (or any other language) enabled. Most hosts allow CGI (even though if programmed wrong can make the system vulnerable) if they don’t allow PHP or some other advanced server-side scripting. Normally, these files need to be placed in the “cgi-bin” to execute. Hosts do this as a sort of precaution, trying to confine the areas of break-ins due to poor programming.

Actually using it is different now. If you’re writing a Perl script, there is no compilation needed, you write like normal. However, if you are a C programmer, such as myself, and wish to use C, compile the source as program.cgi. Now, I’ve dabbled with Perl and can program in it fairly decently, but I’d much rather use C. It’s much easier for me. So, I’ll provide source examples for both styles here!

Now, let’s look at an example script:
The first and most basic script to any sort of programming is “Hello World” so I’ll provide the source for each (and the compiled binaries in the package below for the C-version scripts)

hello_world.pl (This will run properly as is)

#!/usr/bin/perl
# Hello World CGI Script (Perl Version) by Dennis M.
#
# Remember now, comments in Perl must begin with the '#' character

## Our content type ##
print "Content-type: text/html\n\n";

## Now print the page! ##
print "<html>\n
<head><title>Hello World! :D </title></head>\n
<body>\n
<h1>Hello World!</h1>\n
Hello World Script!\n
</body>\n
</html>";

and here is the C source (which, again, needs to be compiled)
hello_world.c

/**
 * Hello World CGI Script (C Version) by Dennis M.
 *
 * I prefer this (although it needs to be compiled) because
 * I'm a C programmer ;)
 *
 * oh yeah, and because we're compiling it with GCC or whatever
 * you use, we can use normal comments ;)
 *
 */

#include <stdio.h>

int main(){
  // Our content type
  printf("Content-Type: text/html;charset=us-ascii\n\n");

  // Our page!
  // We're going to break it up line by line so you can
  // see what's going on here.
  printf("<html>\n");
  printf("<head><title>Hello World! :D </title></head>\n");
  printf("<body>\n");
  printf("<h1>Hello World!</h1>\n");
  printf("Hello world! C style ;) \n");
  printf("</body>\n");
  printf("</html>\n\n");

  // Let's terminate the program now :)
  return 0;
}

Now, we won’t go too deep into the code because simply, they are two completely different languages. But, it’s important to point out that both send headers (Content-type: text/html). You can Google content-type’s and figure what does what, but there are many different types. Another commonly used type is Content-type: text/plain. Notice, if this had been the case, no HTML would have been parsed by the server and everything would have been displayed as plain-text!

So that’s basically it :) CGI is just a wrapper to run Perl and C programming on the web!

Here you can download the sources AND binaries:
CGI Tutorial – Hello World

One more tutorial left in the series! Keep sending in the questions so I have a few more topics to write about! ;)

Regards,
Dennis M.

Categories: C/C++, Other Tags: , , , ,