Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Follow that domain name!
#1
If your site is hosted on a Unix or Linux server which runs Apache, you may already be familiar with your .htaccess file.

What is the .htaccess file?

The .htaccess file is a text file which resides in your main site directory and/or in any subdirectory of your main directory. There can be just one, there can be a separate one in each directory or you may find or create one just in a specific directory. Any commands in a .htaccess file will affect both the directory it is in and any subdirectories of that directory. Thus if you have just one, in your main directory, it will affect your whole site. If you place one in a subdirectory it will affect all the contents of that directory.

From Site-A to Site-B, seamlessly.

Redirection is the name of the game but one must be careful about how it's done. The engines prefer certain redirects over others and the circumstances will dictate which is the best to choose. To illustrate, let's take a close look at the following most common scenario – redirecting from a Mirror Site to a Main Site.

In this situation we have “domain-a” and “domain-b” both pointing to the same content on the server.

A visitor who reaches the mirror site by typing in the domain URL into the address line of their browser would not be able to see any difference between the two sites. This is a very common internet presence strategy but it does have drawbacks – let's examine them:

Drawbacks to mirror sites

Can confuse search engines as to which site it should list.

Once upon a time, when duplicate sites meant more listings, these mirrors helped increase a company's presence in the rankings. However, now that duplication filters eliminate such sites from the listings we see instances where the lesser sites are ranking higher than the main sites. In most cases this is disadvantageous and a problem that needs correcting.

It helps to understand that most search engines, today, "discover" pages. The most frequent scenario being that someone posts a link to a site and the search engine spider discovers that link. From there the spider proceeds to the site to crawl and index it.

If this newly discovered site happens to be a mirror (duplicate) site, this is where the trouble begins. Sometimes the engine will list the “domain-a” page instead of the domain-b.com page – quite possibly assigning it a lower ranking than what the main page would otherwise be ranked at. That's because there are fewer links pointing at this newly discovered site.

This is an inefficient use of incoming links because it spreads them among two pages instead of combining the link popularity into a single page. The end result is lower PageRank (i.e. the "popularity value" given to a certain page by Google) for both pages and, consequently, lower ranking.

But wouldn't the duplication filters kick the page out? Probably – in most cases the search engines will list the site with the most incoming links but we've seen exceptions and, even though engines like Google normally do a good job of figuring out which site is the main site, we've seen instances where they've dropped the main company site and listed the mirror site instead.

B) Can confuse humans as to which site is the correct one to use

By having two or more domains resolving to the same content, you run the risk of having people list the domain you don't want them to in directories, publications, bookmarks and even email addresses. There is also the sales conversion aspect, whereas a customer may be distracted that the domain name in his browser says one thing, but all the contact information on the site talks about a different domain name. This may cause a point of distraction that could be costing sales dollars.

C) Traffic Statistics can be misleading.

Depending on how you have your server setup, you may not be able to generate log files and use them for statistics on the extra domains. Without this information, it may be difficult to know just how many people are actually visiting your site(s).

D) Using robots.txt is tricky.

One solution has always been to use a robots.txt file – the generally accepted way to tell a search engine spider robots NOT to index a site. However you must have your server setup to work correctly in this situation so that you don't also block access to your main site as well. To use the robots.txt file effectively, your server will have to be configured specifically for this purpose. If all your domains share the same root directory, blocking spiders using the robots.txt file method may be difficult to achieve.

Regardless of the drawbacks, there can be good reasons for aliasing your extra domains to your main domain name especially if it's a cost effective way for you to store them while they are active.

You might even have domains that generate browser type-in traffic – the kind where net-surfers guess at a domain name by typing keywords directly into the address line. Just be aware of the drawbacks listed above to avoid shooting yourself in the foot. In most cases you'll find that consolidating the traffic is the better choice.

Use a server 301 "Move Permanently" redirect

Once you've decided to shut down a mirror site to consolidate traffic the method you should use – the method most favored by the search engines – is the 301 redirect.

The "301" header code is generated by the server and tells both the search engine robot and your site visitors that the URL has moved permanently. And, because the evidence we've gathered over the past six months or so indicate that Google and the other engines are doing a good job responding to 301's, this is the method we recommend.

By the way, we've seen numerous instances where Google is transferring the PageRank from an old site to a new one via a 301 redirect. So this is also the method to use if you're moving your site from an old domain to a new domain name.

To generate a 301 redirect

On an Apache server (running UNIX) a 301 redirect is very easy to do. Just enter the following statement into the Apache .htaccess file;

redirect 301 / http:// www .your domain. com/

By placing the above line in the .htaccess file within the root directory, you'll be redirecting all traffic from the old site to whatever site you specify.

If you only want to redirect portions of the old site to the new site, you can place the following text within a single line in the .htaccess file:

redirect 301 /directoryname http:// www. Your domain .com / directoryname

Be forewarned, that doesn't mean that the 301 is a permanent fix-ideally you should seek out and update all incoming links to the new domain name if you wish to maintain your PageRank.


Redirecting traffic using a meta refresh tag, javascript redirect or a server "302" page moved temporarily header.

All of these methods can cause problems with search engines. Search engines like Inktomi sometimes index and list URLs with these kinds of redirects only to index the content on the target page. This will often result in more than one page being listed in the engine in spite of them having the same content.

Example of a 0 (zero) second meta refresh tag

<META HTTP-EQUIV="REFRESH" CONTENT="0; URL=http:// www. Your domain .com">

Example of a 0 (zero) second javascript redirect

<SCRIPT language="JavaScript1.1">
<!--
location.replace("http:// www. Target domain .com/");
//-->
</SCRIPT>
<NOSCRIPT>
<META HTTP-EQUIV="REFRESH" CONTENT="0; URL=http:// www. Target domain .com/">
</NOSCRIPT>

Example of a .htaccess 302 redirect

To employ a 302 redirect on a UNIX based website (Apache server), enter the following statement into the Apache .htaccess file:

redirect 302 / http:// www. your domain .com/

By placing the above line in the .htaccess file within the root directory, you'll be redirecting all traffic from the old site to whatever site you specify.

If you only want to redirect portions of the old site to the new site, you can place the following text within a single line in the .htaccess file;
Support
Webnetics UK Ltd.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)