使用XAMMP创建虚拟主机时遇到问题。虚拟主机始终重定向到localhost。例如,当我键入mysite.local将重定向到localhost / mysite。下面是我的主机和apache配置:
etc / hosts
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
127.0.0.1 mysite.local
/Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf
NameVirtualHost *:80
# localhost
<VirtualHost *:80>
ServerName localhost
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
</VirtualHost>
<VirtualHost *:80>
ServerName mysite.local
ServerAlias mysite.local *.lancome.local
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/mysite"
<Directory "/Applications/XAMPP/xamppfiles/htdocs/mysite">
Options Indexes FollowSymLinks Includes execCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
答案 0 :(得分:0)
1)D:\ xampp \ apache \ conf \ extra \ httpd-vhosts.conf
$stmt = $linkID1->prepare("select slno,video_url,views,downloads from VideoUploads");
$stmt->execute();
$stmt->bind_result($slno,$video_url,$views,$downloads);
$stmt->fetch();
$stmt->close();
2)C:\ Windows \ System32 \ drivers \ etc
<VirtualHost *:80>
DocumentRoot "D:/xampp/htdocs/webshop_moscow/trunk"
ServerName bos.webshop.local
<Directory "D:/xampp/htdocs/webshop_moscow/trunk">
# Order allow,deny
# Allow from all
Require all granted
</Directory>
</VirtualHost>