How do I remove www from all my urls so that search engine can only rank domain.com/ urls under Linux Apache web server?
Add following code to your .htaccess or httpd.conf (directory directive) file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.yourdomain.com$ [NC] RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
If you added directives to httpd.conf, restart Apache:
# service httpd restart