| 301 Redirection Using htaccess |
| Written by Josh Lyon | |||||||||||||||
| Sunday, 06 January 2008 13:41 | |||||||||||||||
|
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.
Bookmark
Email This
Hits: 2179 Comments (4)
![]()
Henrik
said:
|
|
Chief engineer 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! :-) |
|
josh
said:
|
PixPro Follow Up 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 |
|
Annie
said:
|
Protect your PC. Are you searching for antispyware at an affordable price? Then look no further. I have the perfect solution for you. I have found a scan that works as well as Norton and other scans that are more expensive. If you are interested in learning more then you can go to http://www.Search-and-destroy.com and see for yourself what the antispyware solution from Search-and-destroy has to offer. I’m sure that you will be very happy with Search-and-destroy Antispyware because I was and I have tried many different types of scans in the past. It’s a wonderful solution to that will help protect your PC. |
|
| < Prev | Next > |
|---|
