Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在php服务器中从url栏中删除webapp文件夹导航地址?_Php_Url Rewriting_Navigationbar - Fatal编程技术网

如何在php服务器中从url栏中删除webapp文件夹导航地址?

如何在php服务器中从url栏中删除webapp文件夹导航地址?,php,url-rewriting,navigationbar,Php,Url Rewriting,Navigationbar,就像在apache tomcat中一样, 我想从url栏中删除文件夹导航。 我的php服务器(xampp)中有这个目录结构 我想通过ip访问相同的url localhost 这样,我就可以从http://localhost/allsites/site1/public/文件夹与http://localhost。如果public中有任何其他文件夹,它将保持不变,并且可以像,http://localhost/admin 我该怎么做呢?您需要在httpd-vhosts.conf中进行设置,如下所示 &

就像在apache tomcat中一样, 我想从url栏中删除文件夹导航。
我的php服务器(xampp)中有这个目录结构

我想通过ip访问相同的url

localhost
这样,我就可以从
http://localhost/allsites/site1/public/
文件夹与
http://localhost
。如果public中有任何其他文件夹,它将保持不变,并且可以像,
http://localhost/admin


我该怎么做呢?

您需要在httpd-vhosts.conf中进行设置,如下所示

<VirtualHost *:80>
 ServerAdmin webmaster@dummy-host2.example.com
 DocumentRoot "E:/xampp/htdocs/allsites/site1/public/"
 ServerName dummy-host2.example.com
 ErrorLog "logs/dummy-host2.example.com-error.log"
 CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

服务器管理员webmaster@dummy-host2.example.com
DocumentRoot“E:/xampp/htdocs/allsites/site1/public/”
ServerName dummy-host2.example.com
ErrorLog“logs/dummy-host2.example.com error.log”
CustomLog“logs/dummy-host2.example.com access.log”通用

注意:xampp\apache\conf\extra中的这个文件和文档根目录中的yes使用您的xampp文件夹路径

您需要在httpd-vhosts.conf中设置它,如下所示

<VirtualHost *:80>
 ServerAdmin webmaster@dummy-host2.example.com
 DocumentRoot "E:/xampp/htdocs/allsites/site1/public/"
 ServerName dummy-host2.example.com
 ErrorLog "logs/dummy-host2.example.com-error.log"
 CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

服务器管理员webmaster@dummy-host2.example.com
DocumentRoot“E:/xampp/htdocs/allsites/site1/public/”
ServerName dummy-host2.example.com
ErrorLog“logs/dummy-host2.example.com error.log”
CustomLog“logs/dummy-host2.example.com access.log”通用

注意:xampp\apache\conf\extra中的这个文件和文档根目录中的yes使用您的xampp文件夹路径

您需要在httpd-vhosts.conf中设置它,如下所示

<VirtualHost *:80>
 ServerAdmin webmaster@dummy-host2.example.com
 DocumentRoot "E:/xampp/htdocs/allsites/site1/public/"
 ServerName dummy-host2.example.com
 ErrorLog "logs/dummy-host2.example.com-error.log"
 CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

服务器管理员webmaster@dummy-host2.example.com
DocumentRoot“E:/xampp/htdocs/allsites/site1/public/”
ServerName dummy-host2.example.com
ErrorLog“logs/dummy-host2.example.com error.log”
CustomLog“logs/dummy-host2.example.com access.log”通用

注意:xampp\apache\conf\extra中的这个文件和文档根目录中的yes使用您的xampp文件夹路径

您需要在httpd-vhosts.conf中设置它,如下所示

<VirtualHost *:80>
 ServerAdmin webmaster@dummy-host2.example.com
 DocumentRoot "E:/xampp/htdocs/allsites/site1/public/"
 ServerName dummy-host2.example.com
 ErrorLog "logs/dummy-host2.example.com-error.log"
 CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

服务器管理员webmaster@dummy-host2.example.com
DocumentRoot“E:/xampp/htdocs/allsites/site1/public/”
ServerName dummy-host2.example.com
ErrorLog“logs/dummy-host2.example.com error.log”
CustomLog“logs/dummy-host2.example.com access.log”通用

注意:xampp\apache\conf\extra中的这个文件和文档根目录中的yes使用您的xampp文件夹路径

yes,它可以工作。但是,除此之外,我们还应该取消对etc/httpd.conf中Include etc/extra/httpd-vhosts.conf行的注释,并确保您在hosts文件中添加了主机名是的,它可以工作。但是,除此之外,我们还应该取消对etc/httpd.conf中Include etc/extra/httpd-vhosts.conf行的注释,并确保您在hosts文件中添加了主机名是的,它可以工作。但是,除此之外,我们还应该取消对etc/httpd.conf中Include etc/extra/httpd-vhosts.conf行的注释,并确保您在hosts文件中添加了主机名是的,它可以工作。但除此之外,我们还应该在etc/httpd.conf中取消对Include etc/extra/httpd-vhosts.conf行的注释,并确保在hosts文件中添加了主机名