我的域有几个子域,如果用户写入错误的子域,我希望域作为后备。
这些子域有效:
files.myadomain.com、phpmyadmin.mydomain.com 和 server.mydmomain.com
其他域/子域返回 HTTP 500 错误:
由于可能的配置错误,请求超出了 10 个内部重定向的限制。如有必要,使用“LimitInternalRecursion”增加限制。使用“LogLevel debug”获取回溯。
如果我输入一个不存在的子域,我最终会进入 /var/www/
这是配置:
<VirtualHost *:80>
ServerName files.mydomain.com
DocumentRoot /var/www/rcane/files.mydomain.com/
</VirtualHost>
<VirtualHost *:80>
ServerName media.mydomain.com
DocumentRoot /var/www/rcane/media.mydomain.com/
</VirtualHost>
<VirtualHost *:80>
ServerName wordpress.mydomain.com
DocumentRoot /var/www/rcane/wordpress.mydomain.com/
</VirtualHost>
<VirtualHost *:80>
ServerName myml.mydomain.com
DocumentRoot /var/www/johan/ayml/
</VirtualHost>
<VirtualHost *:80>
ServerName johan.mydomain.com
DocumentRoot /var/www/johan/
</VirtualHost>
<VirtualHost *:80>
ServerName phpmyadmin.mydomain.com
DocumentRoot /usr/share/phpmyadmin/
</VirtualHost>
<VirtualHost *:80>
ServerName sqlbuddy.mydomain.com
DocumentRoot /var/www/sqlbuddy/
</VirtualHost>
<VirtualHost *:80>
ServerName server.mydomain.com
DocumentRoot /var/www/
</VirtualHost>
<VirtualHost *:80>
ServerAdmin me@mydomain.com
ServerName mydomain.com
ServerAlias *.mydomain.com
DocumentRoot /var/www/rcane/mydomain.com/
</VirtualHost>
这是带有 LogLevel 调试的错误日志:
[Sat Apr 28 13:42:24 2012] [debug] core.c(3112): [client 01.254.002.30] r->uri = /rcane/server.mydomain.com/
[Sat Apr 28 13:42:24 2012] [debug] core.c(3118): [client 01.254.002.30] redirected from r->uri = /rcane/server.mydomain.com/
[Sat Apr 28 13:42:24 2012] [debug] core.c(3118): [client 01.254.002.30] redirected from r->uri = /rcane/server.mydomain.com/
[Sat Apr 28 13:42:24 2012] [debug] core.c(3118): [client 01.254.002.30] redirected from r->uri = /rcane/server.mydomain.com/
[Sat Apr 28 13:42:24 2012] [debug] core.c(3118): [client 01.254.002.30] redirected from r->uri = /rcane/server.mydomain.com/
[Sat Apr 28 13:42:24 2012] [debug] core.c(3118): [client 01.254.002.30] redirected from r->uri = /rcane/server.mydomain.com/
[Sat Apr 28 13:42:24 2012] [debug] core.c(3118): [client 01.254.002.30] redirected from r->uri = /rcane/server.mydomain.com/
[Sat Apr 28 13:42:24 2012] [debug] core.c(3118): [client 01.254.002.30] redirected from r->uri = /rcane/server.mydomain.com/
[Sat Apr 28 13:42:24 2012] [debug] core.c(3118): [client 01.254.002.30] redirected from r->uri = /rcane/server.mydomain.com/
[Sat Apr 28 13:42:24 2012] [debug] core.c(3118): [client 01.254.002.30] redirected from r->uri = /rcane/server.mydomain.com/
[Sat Apr 28 13:42:24 2012] [debug] core.c(3118): [client 01.254.002.30] redirected from r->uri = /
[Sat Apr 28 13:42:24 2012] [debug] mod_deflate.c(615): [client 01.254.002.30] Zlib: Compressed 627 to 379 : URL /rcane/server.mydomain.com/