I need help with virtualhost settings in apache2. I do not want users to access my website directly using a server ip like http://220.127.116.11 and want to ensure that it opens only when the particular domain (example.com) is typed in. The direct ip access should result in a redirect the example.com.
migrated from stackoverflow.com Aug 17 '10 at 5:20
This question came from our site for professional and enthusiast programmers.
Using mod_rewrite this should work
But this should be moved to serverfault.com
Just create a default VirtualHost which will be defined before any other VirtualHost. If the HTTP/1.1
You can easily put a
For details see In-Depth Discussion of Virtual Host Matching in the Apache httpd documentation.