apache22+freebsd8 中的子域问题
我有域 somedomain.net 链接到某个 IP 123.45.67.89
我需要有这样的子域:
- sub.somedomain.net - 指向 IP 123.45.67.89
- *.sub.somedomain.net - 捕获所有 *. 在 apache.conf 的sub.somedomain.net 中
我有这样的记录:
<VirtualHost *:80>
DocumentRoot "/www/somedomain.net"
ServerName somedomain.net
ServerAlias www.somedomain.net
ServerAlias sub.somedomain.net
ServerAlias *.sub.somedomain.net
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.*)\.somedomain\.net$
RewriteRule ^(.*)$ http://somedomain.net [R,L]
</VirtualHost>
但是打开 http://sub.somedomain 时出现 404 错误.net
在我的域管理面板中我有这样的记录:
somedomain.net IN A 123.45.67.89
somedomain.net IN NS1 ns1.domain-seller.com.
somedomain.net IN NS2 ns2.domain-seller.com.
sub IN A 123.45.67.89
*.sub IN A 123.45.67.89
我的错误在哪里? 谢谢!
PS:我使用的是专用服务器,因此我可以对配置进行任何更改。
I have domain somedomain.net which is linked to some IP 123.45.67.89
I need to have such subdomains:
- sub.somedomain.net - points to IP
123.45.67.89 - *.sub.somedomain.net - catch all *. in sub.somedomain.net
in apache.conf I have such record:
<VirtualHost *:80>
DocumentRoot "/www/somedomain.net"
ServerName somedomain.net
ServerAlias www.somedomain.net
ServerAlias sub.somedomain.net
ServerAlias *.sub.somedomain.net
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.*)\.somedomain\.net$
RewriteRule ^(.*)$ http://somedomain.net [R,L]
</VirtualHost>
But I have 404 error while opening http://sub.somedomain.net
In my domain admin-panel I have such records:
somedomain.net IN A 123.45.67.89
somedomain.net IN NS1 ns1.domain-seller.com.
somedomain.net IN NS2 ns2.domain-seller.com.
sub IN A 123.45.67.89
*.sub IN A 123.45.67.89
Where is my mistake?
Thanks!
PS: I'm using dedicated server, so I can do any changes in configurations.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这看起来不对。如果这是一个绑定文件,您需要编写
sub.somedomain.net
而不仅仅是sub
。That looks wrong. If that's a bind file, you need to write
sub.somedomain.net
and notsub
only.