Category Archives: Search Engine Optimization

.htaccess 101: how to password protect a directory

What’s the easiest way to make an .htaccess file in Unix/Linux so that a directory is password protected? Suppose that your home directory is /home/dmistry and all your webstuff is in /home/dmistry/www/ . Follow these steps:

  1. Make an .htpasswd file. The htpasswd command in Unix does this. You should put the password file outside of your web directory. So a command like “htpasswd -bc /home/dmistry/.htpasswd review donotenter” will create a new file using a username of review and a password of donotenter into the file /home/dmistry/.htpasswd . If you were to run the command “cat /home/dmistry/.htpasswd” you might see a line like “review:M1OdtjdGiDn1Y”.
  2. Make an .htaccess file. In this case, the file would be located at /home/dmistry/www/.htaccess and it would look something like:
    AuthUserFile /home/dmistry/.htpasswd
    AuthName EnterPassword
    AuthType Basic
    <Limit GET POST>
    require valid-user
    </Limit>

Top 5 On Page SEO Tips

Search Engine Optimization is clearly an art, a science, but this does not mean any webmaster can not perform basic SEO. There are several things a webmaster can do to achieve a decent level of visibility in the Search Engine Results Page. Many of these tasks are simple yet often overlooked. I will give you my Top 5 tips which I believe every Webmaster should perform when designing a site.

1. “Meta Tags” – Should be included on all pages, remember though these tags no longer carry the same value they used to in the early search days. Today’s search engines have evolved and now have robust algorithms which take many factors into consideration. The days of “keyword stuffing” will no longer yield in better SERP. Google has gone as far as openly stating that they in fact do not even use the Meta Keyword tag to weigh in on their decision. That being said I strongly believe that all sites should leverage the use of <meta tags> appropriately.

2. “Friendly URL’s”- Make sure all pages on your site have a friendly URL. http://www.domain.com/about-us.html try and avoid long URL’s with many parameter passed. Most search engines can handle URI’s with up to 2 parameters but after that you run the risk that your pages may not get indexed.

3. “Sitemaps” – Create a sitemaps.xml and sitemap.html publish them to the search engines via their submission links. I like to create both pages some people say you only need one.

4. “Robots.txt” - Create a robots.txt file tell the search engine where your sitemap.xml file is located. Most search engines will respect the robots.txt file. BE SURE that you validate the file before publishing, a bad entry could potentially block the crawler from crawling your site all together.

5. “Unique Content”- I personally think this is the biggest of them all, have unique content for your visitors, if you have a site that is just repeating another site what is the incentivefor people to come visit you. Creating easy to read unique content will go very far, think about it, if you have a site that is interesting more people are likley to link to your site, the more “Relevant & Reliable” back links you get the better chance you will rank higher in SERP. I will cover this in more detail on my Top 5 Off Page SEO Tips

Still playing in the Google SandBox

It has been a little less than a week and it appears that Google has decided to let the the site start playing with the rest of the internet. Over the past week the SERP for “Personalized Children’s Book” has shifted from 180′s to the 120′s that a pretty decent drop for a week.

This begs the question, Is this a result of being “released” from the Google age delay filter?, or just the mere fact that Google has index additional pages and is slowly building and calulating our Page Rank.

We have made a few changes to the site, minified the Javascript and CSS which I will talk about a later time, compressed images and added a few more backlinks. Today is exactly 2 months from the day the domain was registered so I am happy with the way things are shaping up so far.

301 Redirect – How to Redirect a Web Page

301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It’s not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it’s the safest option. The code “301″ is interpreted as “moved permanently”.

Below are a Couple of methods to implement URL Redirection

ColdFusion Redirect

<.cfheader statuscode="301" statustext="Moved permanently">
<.cfheader name="Location" value="http://www.new-url.com">

PHP Redirect

<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
?> 

ASP Redirect

<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.new-url.com/"
%> 

ASP .NET Redirect

<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.new-url.com");
}
</script> 

JSP (Java) Redirect

<%
response.setStatus(301);
response.setHeader( "Location", "http://www.new-url.com/" );
response.setHeader( "Connection", "close" );
%> 

CGI PERL Redirect

$q = new CGI;
print $q->redirect("http://www.new-url.com/"); 

Ruby on Rails Redirect

def old_action
headers["Status"] = "301 Moved Permanently"
redirect_to "http://www.new-url.com/"
end 

Redirect Old domain to New domain

Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain.
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

Please REPLACE www.newdomain.com in the above code with your actual domain name.

In addition to the redirect I would suggest that you contact every backlinking site to modify their backlink to point to your new website.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

Redirect to www

Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

Please REPLACE domain.com and www.newdomain.com with your actual domain name.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

The Google “Sandbox” or “Age Delay” Filter

I have read many articles and speculations about the so-called Google “Sandbox” or “Age Delay” filter, from what I have experienced it seems that such a filter does exist. Performing a query for allinanchor:”personalized children’s books” which is the top keyword/phrase I am targeting results in the site being listed on page 2/3  yet querying for keyword/phrase “Personalized Children’s Books” has us on page 18/19.

So how long does this filter apply? How long will the site be “Sand Boxed”? No one really knows the answer to this, but the speculation is that for new domain’s with similar content / material Google wants to keep the ”Age Delay Filter” for approximately 6-12 months. Is this fair? I am partial to both opinions it will help reduce spam sites ensuring the site/domain is something that is going to be around, but on the other hand legitimate sites will take a penalty for quite some time reducing the potential traffic.

Let’s see how long Google makes our site play in the “Sand Box”.