Please refer : [
webmasterworld.com...]
RewriteCond %{HTTP_HOST} ^123\.234\.345\.456(.*)
RewriteRule ^/(.*)$ [
domainname.com...] [R=301,L]
In the rewrite rule “^/(.*)$” helps to prevent the extra trailing slash right after the domain name.
Ex:
If the rule is “(.*)” then apache redirect to www.domainname.com//
If the rule is “^/(.*)$” then Apache redirects to www.domainname.com