Redirect 本地主机/发票的重定向

Redirect 本地主机/发票的重定向,redirect,localhost,hosts,Redirect,Localhost,Hosts,是否可以将我的localhost/invoices目录重定向到仅invoices?也许通过编辑我的主机文件 谢谢我假设当前在/etc/hosts文件中将“localhost”设置为您的本地IP地址。差不多 127.0.0.1 localhost 在这种情况下,请将发票添加到此文件 127.0.0.1 localhost invoices 您还需要修改特定站点的Apache配置文件中的VirtualHost(假设您使用的是Apache): <VirtualHost 127.0.0.

是否可以将我的
localhost/invoices
目录重定向到仅
invoices
?也许通过编辑我的主机文件


谢谢

我假设当前在
/etc/hosts
文件中将“localhost”设置为您的本地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>

服务器名发票
DocumentRoot/path/to/new/directory
...
使用服务器的IP地址和连接的端口。然后需要重新启动web服务器


具体细节将取决于您现有的设置,但希望这足以使用。

您的
/etc/hosts
文件与目录无关。你说的是网络服务器吗?你想干什么?