Link to home
Start Free TrialLog in
Avatar of dancablam
dancablam

asked on

Apache Rewrite or Redirect to Send Requests Made to IP to the Hostname

I'm trying to configure apache to where if the client makes a request to my IP address they are redirected to my hostname and away from the IP. This is what I've tried that doesn't work:

  RewriteEngine on
  RewriteRule ^my.ip.here/(.*) http://www.myurl.com/ [L,R=301]

What's the best practice to achieve what I'm trying to do?

Thanks,
Dan
ASKER CERTIFIED SOLUTION
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial