I want my server to forward ALL domain requests to a single page without having to create any entries in httpd.conf or create a zone file. The page that is forwarded to will handle the request and serve up the results.

eg: I register example.com at lets say godaddy (shudder) add an A record pointing to my server

When a user visits example.com, the a record leads them to the server, I now want the server to show them to a certain page without having to have any record of example.com on the server.

How on earth would I go about doing this??


  • 2
    Doesn't apache do this by default if you don't set up any virtual hosts? What behavior are you seeing instead? – Wooble Aug 16 '12 at 12:21
  • which web server do you use? – oldmonk Aug 16 '12 at 12:23
  • using apache right now i just see the browsers 'unable to find www.example.com message' – Umut Aug 16 '12 at 12:25
  • 1
    Are you sure your request is really being directed to your server? If you do a ping www.example.com on the machine running the browser, does this ping show you the address of your web server? @Umut – alk Aug 16 '12 at 14:58

So I'm guessing you have no ability to modify the actual Apache configuration given that you have said:

without having to have any record of example.com on the server

So what level of access do you have? if you have the ability to use .htaccess then you could potentially use mod_rewrite (assuming mod_rewrite is available on the Apache server):

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?example\.com [NC]
RewriteRule ^(.*)$ http://www.other.com/landing-page.html [R=301,L]

Hope this helps.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy