公司申请了俩网站,www.subanggo.com和www.速帮购.com,服务器上都配好了,今天域名备案成功,于是开始解析,解析中文域名始终不成功,google了一下吗,找到答案了:
中文域名需要先转成punycode,再把punycode绑定到apache的vhost中,关于punycode,维基中解释的很简洁 不在缀余。
用在线工具把shop.速帮购.com转成punycode格式:shop.xn–huT195Hu3B.com,然后再绑定到apache:
#shop.速帮购
<VirtualHost *:80>
DocumentRoot "E:/server/ecmoban/upload"
ServerName shop.xn--huT195Hu3B.com:80
ServerAlias
ServerAdmin webmaster@shop.xn--huT195Hu3B.com
DirectoryIndex index.html index.htm index.php default.php app.php u.php
ErrorLog logs/shop.xn--huT195Hu3B.com-error.log
CustomLog logs/shop.xn--huT195Hu3B.com-access_%Y%m%d.log comonvhost
php_admin_value open_basedir "E:\server\ecmoban\upload\;E:\software\UPUPW_AP5.6-1510\UPUPW_AP5.6\htdocs\;E:\software\UPUPW_AP5.6-1510\UPUPW_AP5.6\memcached\;E:\software\UPUPW_AP5.6-1510\UPUPW_AP5.6\phpmyadmin\;E:\software\UPUPW_AP5.6-1510\UPUPW_AP5.6\temp\;C:\Windows\Temp\"
<Directory "E:/server/ecmoban/upload">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<LocationMatch "/(inc)/(.*)$">
Require all denied
</LocationMatch>
<LocationMatch "/(attachment|attachments|uploadfiles|avatar)/(.*).(php|php5|phps|asp|asp.net|jsp)$">
Require all denied
</LocationMatch>
</VirtualHost>
本文地址: http://xpleeandroid.github.io/2016/10/14/apache-bind-chinese-domain/