• Tiếng Việt (Vietnamese)
  • English (United Kingdom)
Force users to use the WWW or Non-WWW version of your domain
joomla template, virtuemart, phpBB styles, virtuemart, drupal theme, virtuemart, phpBB styles, virtuemart, mootools, virtuemart, phpBB styles, virtuemart, drupal theme, virtuemart, phpBB styles, virtuemart, jQuery, virtuemart, phpBB styles, virtuemart, drupal theme, virtuemart, phpBB styles, virtuemart, mootools, virtuemart, phpBB styles, virtuemart, drupal theme, virtuemart, phpBB styles, virtuemart

To avoid duplicate content in search engines you can force users to use either the www or the non-www version of your website domain. This avoids search engines such as Google indexing two versions of your domain, something which is quite common because people link to both www and on-www versions of a domain (known as the www/non-www canonical issue).

It really doesn’t matter if you use www.joomquery.com or joomquery.com. I personally use www on most sites I own however many people prefer to drop it, it’s really up to you.

SEO SEF SEM

 

 

Force users to use http://www.joomquery.com

To force users to use the www version of your domain all you have to do is add the following code to your .htaccess file (just replace yoursite.com with your domain name).


# Redirect non-www urls to www
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.joomquery\.com
RewriteRule (.*) http://www.joomquery.com/$1 [R=301,L]

Alternatively you can use :


# Redirect non-www urls to www
RewriteEngine on
RewriteCond %{HTTP_HOST} ^joomquery\.com [NC]
RewriteRule (.*) http://www.joomquery.com/$1 [R=301,L]

Force users to use http://joomquery.com

To force users to use the non www version of your domain all you have to do is add the following code to your .htaccess file (just replace yoursite.com with your domain name).


# Redirect www urls to non-www
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.joomquery\.com [NC]
RewriteRule (.*) http://joomquery.com/$1 [R=301,L]

Alternatively you can use :


# Redirect www urls to non-www
RewriteEngine on
RewriteCond %{HTTP_HOST} !^joomquery\.com
RewriteRule (.*) http://joomquery.com/$1 [R=301,L]

 

Many popular scripts, particular content management systems (CMS’s) edit the .htaccess file and add their own redirection so you may not have to add any of the code noted above. Infact, by adding the redirection code noted above you could actually mess things up.

For example, the popular blogging script WordPress adds redirection to the .htaccess file. You simply chose the correct domain name in the admin panel and it takes care of everything else. And if you do add the code to the .htaccess file it messes things up a little. It does still redirect non-www to www (and vice versa) but it just redirects the visitor to the home page (ie. http://joomquery.com/folder1/page1 would redirect to http://joomquery.com/ instead of http://www.joomquery.com/folder1/page1).

If this sounds a little confusing, don’t worry. Just remember that certain scripts already apply a redirection and so trying to add a redirection code to the .htaccess file can mess things up, at the very least it will unlikely work the way you want it to.

htaccessbasics

If you cant Download or have any Suggestions please Contact us

Newer news items:
Older news items:

 

Recommended Web Hosting For Bloggers and Designers

I recoomended Webhostings for Bloggers and Designers because I am freelancer, working with thousand clients in the worlds. Most of them will use those hosts.

vinaora vinaora
Hostting Features:
  1. Fast, Reliable, Affordable
  2. 100% Satisfaction Guarantee
  3. And More...
Special: Reach at 20% discount and 100$ for google adwords

GET STARTED

Comments  

 
0 #1 sam han quoc 2012-05-14 08:23
Cám ơn admin. Bài viết rất bổ ích. Mình đã làm được.
Quote
 

Add comment


Security code
Refresh

Contact Us

Xindira Tower, Tay Mo - Tu Liem Dist, Hanoi, Vietnam

Tel: +84 (4) 3 789 3 442

phpBB phpBB phpBB phpBB

Follow Us

phpBB phpBB


Favourites links

may tinh bang | callingcardsdirect.co.uk | sim so dep