Catch all non existing subdomains

Discussion in 'Apache' started by clover, Jan 20, 2008.

  1. #1
    clover, Jan 20, 2008 IP
  2. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Hello,

    Yes, but you need access to your DNS configuration (to make a Wildcarded DNS Record) and then access to the httpd.conf file to create a wildcarded alias. To you have access to both of these?

    Jay
     
    jayshah, Jan 21, 2008 IP
  3. powerspike

    powerspike Peon

    Messages:
    312
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If you add in
    ServerAlias *.domain.com
    into the virtualhost it'll put all the domains to the site
    then you just need to add in a htaccess rewrite rule that will point any requests that aren't to your main domain to that page using a 301 redirect.
     
    powerspike, Jan 22, 2008 IP