Wildcard DNS, Wildcard ServerName, Rewrite/Problems.

Wildcard DNS, Wildcard ServerName, Rewrite/Problems.

Post by Mike Zimmerm » Wed, 12 May 1999 04:00:00



Hello all,

        I'm having some trouble with setting up a virtual system that points
all sublevel domains to a single file which does all the work. On a static
name, such as www.domain.com, the rules work, and the page is rewritten
properly, and the code works fine. When wildcarded, the server goes into an
endless loop of 302 redirects. Example:

DNS:

*       IN      A       128.0.0.1

<VirtualHost 128.0.0.1>
DocumentRoot /www/
ServerName *.domain.com
Rewri*gine On
RewriteOptions inherit
</VirtualHost>

Rules (inherited from primary host):

RewriteCond %{REMOTE_ADDR} .*
RewriteRule ^/robots.txt /www/robots.txt [L]

RewriteCond %{REMOTE_ADDR} .*
RewriteRule ^/(.*) http://%{HTTP_HOST}/engine/index.html [L]

Can anyone shed some light on how to fix this? I need to have the response
sent back as a 200, which is what it does when using a fixed name such as
www.domain.com.

Any help would be appreciated.

Thanks,

Mike

 
 
 

Wildcard DNS, Wildcard ServerName, Rewrite/Problems.

Post by Joshua Sliv » Wed, 12 May 1999 04:00:00



> Hello all,
>         I'm having some trouble with setting up a virtual system that points
> all sublevel domains to a single file which does all the work. On a static
> name, such as www.domain.com, the rules work, and the page is rewritten
> properly, and the code works fine. When wildcarded, the server goes into an
> endless loop of 302 redirects. Example:
> Rules (inherited from primary host):
> RewriteCond %{REMOTE_ADDR} .*
> RewriteRule ^/robots.txt /www/robots.txt [L]
> RewriteCond %{REMOTE_ADDR} .*
> RewriteRule ^/(.*) http://%{HTTP_HOST}/engine/index.html [L]

What are the RewriteCond's for?  They don't do anything.  This should
be closer:

RewriteRule ^/engine/index.html$ - [L]
RewriteRule ^/robots.txt /www/robots.txt [L]
RewriteRule ^/(.*) http://%{HTTP_HOST}/engine/index.html [L]

--
Joshua Slive

http://finance.commerce.ubc.ca/~slive/

 
 
 

Wildcard DNS, Wildcard ServerName, Rewrite/Problems.

Post by Mike Zimmerm » Thu, 13 May 1999 04:00:00




>> Hello all,

>>         I'm having some trouble with setting up a virtual system that points
>> all sublevel domains to a single file which does all the work. On a static
>> name, such as www.domain.com, the rules work, and the page is rewritten
>> properly, and the code works fine. When wildcarded, the server goes into an
>> endless loop of 302 redirects. Example:

>> Rules (inherited from primary host):

>> RewriteCond %{REMOTE_ADDR} .*
>> RewriteRule ^/robots.txt /www/robots.txt [L]

>> RewriteCond %{REMOTE_ADDR} .*
>> RewriteRule ^/(.*) http://%{HTTP_HOST}/engine/index.html [L]

>What are the RewriteCond's for?  They don't do anything.  This should
>be closer:

>RewriteRule ^/engine/index.html$ - [L]
>RewriteRule ^/robots.txt /www/robots.txt [L]
>RewriteRule ^/(.*) http://%{HTTP_HOST}/engine/index.html [L]

The conditions for

RewriteCond %{REMOTE_ADDR} .*
RewriteRule ^/(.*) http://%{HTTP_HOST}/engine/index.html [L]

actually exist in the conf file in the form of IP blocks. For simplicity's
sake (there are a LOT of lines of conditions), I removed them since I've
already determined they aren't affecting the problem.

 
 
 

1. wildcards in ServerName

I was wondering if you could use wildcards for the ServerName in IP
based virtual hosting, something like:

Listen 80

<VirtualHost 192.168.1.200:80>
 DocumentRoot /www/example1
 ServerName www.example1.com
</VirtualHost>

<VirtualHost 192.168.1.201:80>
 DocumentRoot /wc/example2
 ServerName wc.*.example2.com   // <---- Notice "all" wildcard
 ServerAlias *.example2.com
</VirtualHost>

 In a way that all requests like wc.wc68.example2.com and
wc.xyz.example2.com would be served by example2.com.

 All I am trying to do is catch all request with a "Host" header
prefixed like "wc." and send them to a different webserver possibly
running on another port

 How can you do this? In case you can not, is there  way to do
something similar?

 The examples I found on:

http://httpd.apache.org/docs-2.0/vhosts/examples.html

 were not helpful to me.

2. HELP! at LILO, get "unable to fill buffer system halted"?!

3. Rewrite with wildcards

4. Come on guys!!!

5. DNS/URL "wildcards"

6. Boca 4-port board help

7. Do DNS wildcards have a propagation delay?

8. setting up a linux network

9. DNS Search - using wildcard

10. : How to do DNS search with wildcards?

11. MX wildcards in DNS

12. virtualhosts- enabling wildcards on DNS

13. mv problem : how to use wildcard function *,?