我已成功更改我的htdocs目录并添加了servername。但我现在的问题是,当访问localhost时,如何自动将localhost更改为我的servername。 就像当我输入url localhost / onlineshopping /它会自动更改为sniper / onlineshopping /.
<VirtualHost *:80>
DocumentRoot "C:\xampp\jp"
ServerName sniper
ServerAlias sniper
<Directory "C:\xampp\jp">
Options Indexes
AllowOverride None
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>