About Me

Josh Lyon

Name: Joshua Lyon
Birthday: August 8, 1985
Location: Grapevine, TX
E-mail: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it

feed image
Home arrow Photo Gallery
Jan 06 2008
301 Redirection Using htaccess
Written by Josh Lyon   
Sunday, 06 January 2008
 

The following post is about using redirection to keep your existing search engine ranking for content on an old domain. Here's my story: I purchased multiple domains and by default set them to all direct to the same content (eg. document root). When I started my search engine optimization kick I realized that different domains got better search engine rankings than others - even on the EXACT same content. And google thought that I had more links from external sites than I actually did. Some of you might think that sounds good because there were more external links than there should be, but most of them were links to things I didn't want high links to like my registration page, site search, etc.

I finally moved my sites to a new server and decided it was probably a good time to start segregating my domain content. I plan on retiring flamingcube.com sometime later in the year, so I'm trying to get the SEO results for it transitioned to the new server. I plan on using the other domains I have registered for completely new sites so I want to start getting all the content pushed over now so in a few months I can remove the redirects and start with new content.

Redirect Old domain to New domain

Simply create an .htaccess file in the root of your domains document root (often public_html) - this is the same place you would probably have an index.html file. Add the following text to the .htaccess file and save it. Make sure you replace newdomain.com with your new domain you want the content redirected to.

Options +FollowSymLinks

RewriteEngine on

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

I should note that this method of redirection only works on servers that support the mod_rewrite apache module. This would typically just mean Apache servers with mod_rewrite installed, but you can get it working on IIS servers if you have a similar mod_rewrite module that can parse htaccess files.

Redirect www and other domains to proper domain

This is the next peice of my SEO kick. I'm testing out a new search component for Joomla called PixSearch that creates a search dropdown similar to Apple.com. It uses AJAX to send your request to the site search while you are typing and pulls up search results directly on the page. The only issue with this is the search module uses the joomla defined site domain to do the search. If you land on the page using a subdomain or other domain that points to the same document root the search will fail to execute to prevent XSS (cross site scripting) vulnerabilities.

Regardless, it's probably a good idea to standards your domains and use the proper redirection. This updates search engines and makes it easier for coders to develop software.

Options +FollowSymlinks

RewriteEngine on

rewritecond %{http_host} ^domain.com [nc]

rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

As with the other .htacess file, replace the domain names with your actual domain name.

Related articles.

User Comments (2)RSS feed comment
 
Henrik said:
I will try to change this domain issue in the next version. 
Just wanted to take a look on your progress on implementing pixsearch, seems you made it! 
 
Congratz! :-)
Date: 01/14/2008 01:49:53 AM - Title: Chief engineer
Josh Lyon said:
Henrik, thanks for the follow up. I should note that I decided not to port PixSearch from MooTools to Prototype. As MooTools is the Joomla 1.5 supported javascript framework, I decided to work with the comment component I am using and make some changes to it so it is more compatible with the MooTools framework. 
 
I didn't include a link to the PixSearch site in the article, so here's one: PixSearch Home
Date: 01/14/2008 02:30:08 AM - Title: PixPro Follow Up

Displaying 2 of 2 comments


Add Comment
Name
E-mail
Title  
Comment
 
Available characters: 600
   Notify me of follow-up comments
  Mathguard security question:
BIJ         RI4      
  S    O      J   PU4
3NM   YAJ     C      
  6    J      2   952
NQH           I      
   
   

 

Add your comment



mXcomment 1.0.8 © 2007-2008 - visualclinic.fr
License Creative Commons - Some rights reserved
< Prev   Next >