Apache redirect www.domain.com to domain.com
Q. How do I remove www from all my urls so that search engine can only rank domain.com/ urls under Linux Apache web server?
A. 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
E-mail
Print
Can't find an answer to your question? Contact us
Related Other Helpful FAQs:
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: .htaccess, /etc/init.d/httpd, apache .htaccess, apache2 .htaccess, htaccess file, httpd .htaccess, httpd.conf, linux apache, redirect url, restart apache web server, rewriterule, search engine, urls




June 3rd, 2008 at 12:05 pm
Hi,
can someone pls write me how to have primary apache server through https which will send requests to some local apache through http.
Cheers, Igor