Home > Backend Development > PHP Tutorial > php-PHP:用httpd.conf设置虚拟路径,为什么我这样作了之后仍不能访问呢

php-PHP:用httpd.conf设置虚拟路径,为什么我这样作了之后仍不能访问呢

WBOY
Release: 2016-06-02 11:34:42
Original
959 people have browsed it

phpapache

直接在浏览器中访问localhost/demo,则会自动显示/htdocs/demo下的index.html页面
下面修改httpd.conf,为该工程配置虚拟路径,如下

<code>LoadModule rewrite_module modules/mod_rewrite.so<ifmodule aliad_module>Alias /test "/usr/local/apache2/htdocs/demo/"</ifmodule><directory>AllowOverride NoneOptions NoneOrder allow,denyAllow from all</directory></code>
Copy after login

最后重启apache,通过localhost/test无法访问该工程,显示为

<code>Not FoundThe requested URL /test was not found on this server.Apache/2.0.65(Unix) DAV/2 Server at localhost Port 80</code>
Copy after login

/apache2/logs/error_log报错如下

<code>[error][client 127.0.0.1]File does not exist:/usr/local/apache2/htdocs/test</code>
Copy after login

请前辈们看一下,我这个虚拟路径为什么配的不正确呢?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template