I am using the following code in my httpd.conf
for redirections:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
But, it ends up redirecting to www.domain.com/domain.com//domain.com//domain.com
I want all the following URLs to redirect to domain.com:
http://domain.com
http://www.domain.com
www.domain.com
This should do it. The problem is that it looks pretty much like what you already have. When you type http://domain.com
in your browser, does it work? Or does it redirect to somewhere else?
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.domain\.com
RewriteRule ^(.*)$ http://domain.com$1 [R=permanent,L]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With