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
Possibly Related Posts:
- Linux local privilege escalation via SUID
- How to uninstall Vmware workstation v 8.0.0.471780.bundle
- Windows : HOw to delete Tmp filed through cmd?
- Linux : Flash fullscreen doesn’t work on Ubuntu 10.10
- Windows 7 – Enable Telnet
