是否可以将我的localhost/invoices
目录重定向到 just invoices
?也许通过编辑我的主机文件?
谢谢
我假设“localhost”当前在/etc/hosts
文件中设置为您的本地 IP 地址。就像是
127.0.0.1 localhost
在这种情况下,将发票添加到此文件
127.0.0.1 localhost invoices
您还需要为该特定站点修改 Apache 配置文件中的 VirtualHost(假设您使用的是 Apache):
<VirtualHost 127.0.0.1:80>
ServerName invoices
DocumentRoot /path/to/new/directory
...
</VirtualHost>
使用您的服务器的 IP 地址和您连接的端口。然后,您将需要重新启动您的 Web 服务器。
具体细节将取决于您现有的设置,但希望这足以使用。