问题描述
- PHP:用httpd.conf设置虚拟路径,为什么我这样作了之后仍不能访问呢
-
直接在浏览器中访问localhost/demo,则会自动显示/htdocs/demo下的index.html页面
下面修改httpd.conf,为该工程配置虚拟路径,如下LoadModule rewrite_module modules/mod_rewrite.so <IfModule aliad_module> Alias /test "/usr/local/apache2/htdocs/demo/" </IfModule> <Directory "/usr/local/apache2/htdocs/demo/"> AllowOverride None Options None Order allow,deny Allow from all </Directory>
最后重启apache,通过localhost/test无法访问该工程,显示为
Not Found The requested URL /test was not found on this server. Apache/2.0.65(Unix) DAV/2 Server at localhost Port 80
/apache2/logs/error_log报错如下
[error][client 127.0.0.1]File does not exist:/usr/local/apache2/htdocs/test
请前辈们看一下,我这个虚拟路径为什么配的不正确呢?
解决方案
是不是这个模块LoadModule vhost_alias_module modules/mod_vhost_alias.so问题
时间: 2024-08-29 09:18:16