Can i block/deny/redirect accesses that do not have VirtualHost entry in httpd.conf?

Discussion in 'Apache' started by postcd, Mar 7, 2017.

  1. #1
    Hello,

    some domains are pointing to my server and webserver log is being flooded by entries like: File does not exist: /usr/local/apache/htdocs/somesubpagehere

    Can i block/deny or redirect (to another external URL) visits that do not have virtualhost entry in httpd.conf? How to do it?

    Thank You
     
    postcd, Mar 7, 2017 IP
  2. Andrew Shaw

    Andrew Shaw Member

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #2
    You should have default virtual host. Which is the vhost a connection is given if it doesn't recognise the domain-name.
    simply add a redirect to the URL of your choice in a .htaccess file in your default vhost.
     
    Andrew Shaw, Mar 13, 2017 IP