Seo importance, Joomla site with or without www, .htaccess 301 redirection

joomla, Seo importance, Joomla site with or without www, .htaccess 301 redirection, seo 300x218

Here is the litle peace of code that will improve your SEO.

In order to reduce duplicant content you need to 301 redirected the non www version of the url as well as the /index.php version of the home page url to www version of your site.

Paste this code in your .htaccess file then change yoursite.com to the name of your site and all the forms of your sites first page

  • yoursite.com,
  • yoursite.com/index.php and
  • yoursite.com/index.php?option=com_frontpage&Itemid=1

will be redirected to www.yoursite.com


########## Begin - 301 Redirect
 Options +FollowSymLinks
 RewriteEngine on
 RewriteCond %{HTTP_HOST} ^yoursite\.com$ [NC]
 RewriteRule .* <!-- m -->http://www.yoursite.com/<!-- m --> [L,R=301]
 #
 RewriteEngine On
 RewriteBase /
 RewriteCond %{HTTP_HOST} !^www\.yoursite\.com$
 RewriteRule ^(.*)$ <!-- m -->http://www.yoursite.com/$1<!-- m --> [R=301,L]
 RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
 RewriteRule index\.php$ <!-- m -->http://www.yoursite.com/<!-- m -->%1 [R=301,L]
 #
 RewriteCond %{QUERY_STRING} ^option=com_frontpage&Itemid=1$
 RewriteRule ^index\.php$ <!-- m -->http://www.yoursite.com/<!-- m -->? [R=301,L]
 ########## End - 301 Redirect

If you think this code was helpful, share it with your friends.

Popularity: 5% [?]

Related posts:

  1. Speeding up WP Super Cache by changing htaccess file
  2. Speeding up joomla site, making it load faster
  3. How to add description to Joomla Marketplace?
  4. How to remove joomla generator tag?
  5. [How to] Add message counter to Mosets Tree

Twitter Digg Delicious Stumbleupon Technorati Facebook

No comments yet... Be the first to leave a reply!