0

I have the following httpd configuration to allow subdomains and to redirect www url to non-www url:

ServerName example.com:80

NameVirtualHost *:80

<VirtualHost *:80>
  ServerName example.com
  ServerAlias (a([c-g]|i|[l-o]|[q-u]|w|x|z)|z(a|m|w)).example.com
</VirtualHost>

<VirtualHost *:80>
  ServerName www.example.com
  Redirect permanent / http://example.com/
</VirtualHost>

I want to test that these settings are valid. I thought initially that placing those urls in the hosts file would enable me to do that. But it doesn't seem so as any subdomains that does not match ServerAlias in virtual host can still run. So can this be done without a DNS?

1 Answer 1

0

You could telnet to localhost:80 and manually issue the HTTP requests then check that you receive the correct response.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .